diff options
author | Robert Phillips <robertphillips@google.com> | 2017-03-29 12:08:49 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-29 17:00:16 +0000 |
commit | 301431d7516a18e2b4232ccb70d2a79e8192c748 (patch) | |
tree | 5af992a5a1b311ca03c929e5097312cd9c48e334 /tests/ClearTest.cpp | |
parent | e7d30484ea8a5677a9403ccd23a9c0961df62ccd (diff) |
Miscellaneous GrSurfaceProxy-related cleanup
This is pulled out of: https://skia-review.googlesource.com/c/10284/ (Remove GrSurface-derived classes from ops)
Change-Id: I083c0beefe4899b3517d0b0569bb25096809f410
Reviewed-on: https://skia-review.googlesource.com/10483
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests/ClearTest.cpp')
-rw-r--r-- | tests/ClearTest.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/ClearTest.cpp b/tests/ClearTest.cpp index d4b85872d8..843c4c371c 100644 --- a/tests/ClearTest.cpp +++ b/tests/ClearTest.cpp @@ -17,12 +17,17 @@ static bool check_rect(GrRenderTargetContext* rtc, const SkIRect& rect, uint32_t expectedValue, uint32_t* actualValue, int* failX, int* failY) { - GrRenderTarget* rt = rtc->accessRenderTarget(); int w = rect.width(); int h = rect.height(); std::unique_ptr<uint32_t[]> pixels(new uint32_t[w * h]); memset(pixels.get(), ~expectedValue, sizeof(uint32_t) * w * h); - rt->readPixels(rect.fLeft, rect.fTop, w, h, kRGBA_8888_GrPixelConfig, pixels.get()); + + SkImageInfo dstInfo = SkImageInfo::Make(w, h, kRGBA_8888_SkColorType, kPremul_SkAlphaType); + + if (!rtc->readPixels(dstInfo, pixels.get(), 0, rect.fLeft, rect.fTop)) { + return false; + } + for (int y = 0; y < h; ++y) { for (int x = 0; x < w; ++x) { uint32_t pixel = pixels.get()[y * w + x]; |