diff options
author | Robert Phillips <robertphillips@google.com> | 2017-07-21 15:37:19 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-24 13:05:29 +0000 |
commit | e44ef10ebbc7f64b627a9ac3a562bd87b3001b0c (patch) | |
tree | c18b1b3d41f1ef0c6a2133a45d3b697e0071eba8 /tests | |
parent | 40e7e655341c5bf56e398cd2f5902dda79d702a0 (diff) |
Second small fragment from "Reduce dependence on GrSurface's origin field"
TBR=bsalomon@google.com
Change-Id: Ifcfe56b1117b64821b2bfc34ba36d120227d15fa
Reviewed-on: https://skia-review.googlesource.com/25802
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ImageFilterCacheTest.cpp | 3 | ||||
-rw-r--r-- | tests/ProcessorTest.cpp | 3 | ||||
-rw-r--r-- | tests/ProxyRefTest.cpp | 1 | ||||
-rw-r--r-- | tests/ReadWriteAlphaTest.cpp | 2 | ||||
-rw-r--r-- | tests/ResourceCacheTest.cpp | 2 | ||||
-rw-r--r-- | tests/SRGBMipMapTest.cpp | 1 | ||||
-rw-r--r-- | tests/SpecialImageTest.cpp | 3 | ||||
-rw-r--r-- | tests/SurfaceTest.cpp | 6 |
8 files changed, 15 insertions, 6 deletions
diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp index d718181758..86ecb15f6e 100644 --- a/tests/ImageFilterCacheTest.cpp +++ b/tests/ImageFilterCacheTest.cpp @@ -190,8 +190,9 @@ static sk_sp<GrTextureProxy> create_proxy(GrResourceProvider* resourceProvider) SkBitmap srcBM = create_bm(); GrSurfaceDesc desc; - desc.fConfig = kRGBA_8888_GrPixelConfig; desc.fFlags = kNone_GrSurfaceFlags; + desc.fOrigin = kTopLeft_GrSurfaceOrigin; + desc.fConfig = kRGBA_8888_GrPixelConfig; desc.fWidth = kFullSize; desc.fHeight = kFullSize; diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp index fd025a0cb4..eac6aab274 100644 --- a/tests/ProcessorTest.cpp +++ b/tests/ProcessorTest.cpp @@ -302,9 +302,10 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, repor sk_sp<GrRenderTargetContext> rtc = context->makeDeferredRenderTargetContext( SkBackingFit::kExact, 256, 256, kRGBA_8888_GrPixelConfig, nullptr); GrSurfaceDesc desc; + desc.fFlags = kRenderTarget_GrSurfaceFlag; + desc.fOrigin = kBottomLeft_GrSurfaceOrigin; desc.fWidth = 256; desc.fHeight = 256; - desc.fFlags = kRenderTarget_GrSurfaceFlag; desc.fConfig = kRGBA_8888_GrPixelConfig; sk_sp<GrTextureProxy> proxies[2]; diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp index 04510b3e7f..a30766b838 100644 --- a/tests/ProxyRefTest.cpp +++ b/tests/ProxyRefTest.cpp @@ -80,6 +80,7 @@ static sk_sp<GrTextureProxy> make_deferred(GrContext* context) { static sk_sp<GrTextureProxy> make_wrapped(GrContext* context) { GrSurfaceDesc desc; desc.fFlags = kRenderTarget_GrSurfaceFlag; + desc.fOrigin = kBottomLeft_GrSurfaceOrigin; desc.fWidth = kWidthHeight; desc.fHeight = kWidthHeight; desc.fConfig = kRGBA_8888_GrPixelConfig; diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp index 344400cca7..2e5a1dc12d 100644 --- a/tests/ReadWriteAlphaTest.cpp +++ b/tests/ReadWriteAlphaTest.cpp @@ -50,6 +50,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { { GrSurfaceDesc desc; desc.fFlags = kNone_GrSurfaceFlags; + desc.fOrigin = kTopLeft_GrSurfaceOrigin; desc.fConfig = kAlpha_8_GrPixelConfig; // it is a single channel texture desc.fWidth = X_SIZE; desc.fHeight = Y_SIZE; @@ -153,6 +154,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { for (int rt = 0; rt < 2; ++rt) { GrSurfaceDesc desc; desc.fFlags = rt ? kRenderTarget_GrSurfaceFlag : kNone_GrSurfaceFlags; + desc.fOrigin = rt ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOrigin; desc.fConfig = config; desc.fWidth = X_SIZE; desc.fHeight = Y_SIZE; diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp index b018b8f33a..b27aaea9f7 100644 --- a/tests/ResourceCacheTest.cpp +++ b/tests/ResourceCacheTest.cpp @@ -1673,6 +1673,8 @@ static sk_sp<GrTextureProxy> make_mipmap_proxy(GrResourceProvider* provider, GrSurfaceDesc desc; desc.fFlags = flags; + desc.fOrigin = (flags & kRenderTarget_GrSurfaceFlag) ? kBottomLeft_GrSurfaceOrigin + : kTopLeft_GrSurfaceOrigin; desc.fWidth = width; desc.fHeight = height; desc.fConfig = kRGBA_8888_GrPixelConfig; diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp index 8d035e1589..07332e4282 100644 --- a/tests/SRGBMipMapTest.cpp +++ b/tests/SRGBMipMapTest.cpp @@ -124,6 +124,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBMipMaps, reporter, ctxInfo) { // Create our test texture GrSurfaceDesc desc; desc.fFlags = kNone_GrSurfaceFlags; + desc.fOrigin = kTopLeft_GrSurfaceOrigin; desc.fConfig = kSRGBA_8888_GrPixelConfig; desc.fWidth = texS; desc.fHeight = texS; diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp index 70d6fd4b38..3574f38129 100644 --- a/tests/SpecialImageTest.cpp +++ b/tests/SpecialImageTest.cpp @@ -301,8 +301,9 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_DeferredGpu, reporter, ctxInfo) SkBitmap bm = create_bm(); GrSurfaceDesc desc; - desc.fConfig = kSkia8888_GrPixelConfig; desc.fFlags = kNone_GrSurfaceFlags; + desc.fOrigin = kTopLeft_GrSurfaceOrigin; + desc.fConfig = kSkia8888_GrPixelConfig; desc.fWidth = kFullSize; desc.fHeight = kFullSize; diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp index 5249b3d562..797750f3b1 100644 --- a/tests/SurfaceTest.cpp +++ b/tests/SurfaceTest.cpp @@ -599,7 +599,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture( backendHandle); sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTexture(context, backendTex, - kDefault_GrSurfaceOrigin, sampleCnt, + kTopLeft_GrSurfaceOrigin, sampleCnt, nullptr, nullptr); if (!surface) { context->getGpu()->deleteTestingOnlyBackendTexture(backendHandle); @@ -625,7 +625,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture_as_render_target( kRGBA_8888_GrPixelConfig, backendHandle); sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTextureAsRenderTarget( - context, backendTex, kDefault_GrSurfaceOrigin, sampleCnt, nullptr, nullptr); + context, backendTex, kTopLeft_GrSurfaceOrigin, sampleCnt, nullptr, nullptr); if (!surface) { context->getGpu()->deleteTestingOnlyBackendTexture(backendHandle); @@ -907,7 +907,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCreationWithColorSpace_Gpu, reporter, backendHandle); return SkSurface::MakeFromBackendTexture(context, backendTex, - kDefault_GrSurfaceOrigin, 0, + kTopLeft_GrSurfaceOrigin, 0, sk_ref_sp(info.colorSpace()), nullptr); }; |