diff options
author | Robert Phillips <robertphillips@google.com> | 2017-04-06 21:17:15 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-06 21:17:26 +0000 |
commit | 9a121cc6ad746c37611229dc0ec1805545c4d2e0 (patch) | |
tree | bac71009c511cb048a6152e3b5698aea5c735b01 /tests/BlendTest.cpp | |
parent | 7754ccce726b09e78d269804c1c11e1718965301 (diff) |
Revert "Make GrCopySurfaceOp friendlier to GrSurfaceProxy"
This reverts commit d7cda9a6f050c30e65b0744b3cfb45cecdc40834.
Reason for revert: Tegra3!!!!
Original change's description:
> Make GrCopySurfaceOp friendlier to GrSurfaceProxy
>
> Change-Id: Iba8c068bd96ab154d466e485a9db31dd552138de
> Reviewed-on: https://skia-review.googlesource.com/11325
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
>
TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Idc31d469d94e6e2772ee5714987b3a05bb902d88
Reviewed-on: https://skia-review.googlesource.com/11580
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/BlendTest.cpp')
-rw-r--r-- | tests/BlendTest.cpp | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/tests/BlendTest.cpp b/tests/BlendTest.cpp index 08190f1762..2d16fb2ff2 100644 --- a/tests/BlendTest.cpp +++ b/tests/BlendTest.cpp @@ -84,26 +84,23 @@ DEF_TEST(Blend_byte_multiply, r) { namespace { static sk_sp<SkSurface> create_gpu_surface_backend_texture_as_render_target( GrContext* context, int sampleCnt, int width, int height, GrPixelConfig config, - GrSurfaceOrigin origin, sk_sp<GrTexture>* backingSurface) { GrSurfaceDesc backingDesc; - backingDesc.fFlags = kRenderTarget_GrSurfaceFlag; - backingDesc.fOrigin = origin; - backingDesc.fWidth = width; backingDesc.fHeight = height; + backingDesc.fWidth = width; backingDesc.fConfig = config; - backingDesc.fSampleCnt = sampleCnt; + backingDesc.fOrigin = kDefault_GrSurfaceOrigin; + backingDesc.fFlags = kRenderTarget_GrSurfaceFlag; *backingSurface = context->resourceProvider()->createTexture(backingDesc, SkBudgeted::kNo); GrBackendTextureDesc desc; - desc.fFlags = kRenderTarget_GrBackendTextureFlag; - desc.fOrigin = origin; + desc.fConfig = config; desc.fWidth = width; desc.fHeight = height; - desc.fConfig = config; - desc.fSampleCnt = sampleCnt; + desc.fFlags = kRenderTarget_GrBackendTextureFlag; desc.fTextureHandle = (*backingSurface)->getTextureHandle(); + desc.fSampleCnt = sampleCnt; sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTextureAsRenderTarget(context, desc, nullptr); return surface; @@ -130,35 +127,31 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ES2BlendWithNoTexture, reporter, ctxInfo) }; struct TestCase { - RectAndSamplePoint fRectAndPoints; - SkRect fClip; - int fSampleCnt; - GrSurfaceOrigin fOrigin; + RectAndSamplePoint rectAndPoints; + SkRect clip; + int sampleCnt; }; std::vector<TestCase> testCases; - for (auto origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin}) { - for (int sampleCnt : {0, 4}) { - for (auto rectAndPoints : allRectsAndPoints) { - for (auto clip : {SkRect::MakeXYWH(0, 0, 10, 10), SkRect::MakeXYWH(1, 1, 8, 8)}) { - testCases.push_back({rectAndPoints, clip, sampleCnt, origin}); - } + for (int sampleCnt : {0, 4}) { + for (auto rectAndPoints : allRectsAndPoints) { + for (auto clip : {SkRect::MakeXYWH(0, 0, 10, 10), SkRect::MakeXYWH(1, 1, 8, 8)}) { + testCases.push_back({rectAndPoints, clip, sampleCnt}); } } } // Run each test case: for (auto testCase : testCases) { - int sampleCnt = testCase.fSampleCnt; - SkRect paintRect = testCase.fRectAndPoints.rect; - SkIPoint outPoint = testCase.fRectAndPoints.outPoint; - SkIPoint inPoint = testCase.fRectAndPoints.inPoint; - GrSurfaceOrigin origin = testCase.fOrigin; + int sampleCnt = testCase.sampleCnt; + SkRect paintRect = testCase.rectAndPoints.rect; + SkIPoint outPoint = testCase.rectAndPoints.outPoint; + SkIPoint inPoint = testCase.rectAndPoints.inPoint; sk_sp<GrTexture> backingSurface; // BGRA forces a framebuffer blit on ES2. sk_sp<SkSurface> surface = create_gpu_surface_backend_texture_as_render_target( - context, sampleCnt, kWidth, kHeight, kConfig, origin, &backingSurface); + context, sampleCnt, kWidth, kHeight, kConfig, &backingSurface); if (!surface && sampleCnt > 0) { // Some platforms don't support MSAA. @@ -168,7 +161,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ES2BlendWithNoTexture, reporter, ctxInfo) // Fill our canvas with 0xFFFF80 SkCanvas* canvas = surface->getCanvas(); - canvas->clipRect(testCase.fClip, false); + canvas->clipRect(testCase.clip, false); SkPaint black_paint; black_paint.setColor(SkColorSetRGB(0xFF, 0xFF, 0x80)); canvas->drawRect(SkRect::MakeXYWH(0, 0, kWidth, kHeight), black_paint); |