Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: tests/RectangleTextureTest.cpp

Issue 2163323002: Add desired width & height to drawContext (as opposed to using the width & height of the RT) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More Clean up Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RectangleTextureTest.cpp
diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp
index 2fa51e2ba22f8db4f29487f51f36ee08b764672d..51f7b44cff8f9f3843ddb8932d1b1e06dcb3db7c 100644
--- a/tests/RectangleTextureTest.cpp
+++ b/tests/RectangleTextureTest.cpp
@@ -89,8 +89,11 @@ static void test_copy_surface_dst(skiatest::Reporter* reporter, GrContext* conte
static void test_clear(skiatest::Reporter* reporter, GrContext* context,
GrTexture* rectangleTexture) {
if (rectangleTexture->asRenderTarget()) {
+ int w = rectangleTexture->width();
+ int h = rectangleTexture->height();
+
sk_sp<GrDrawContext> dc(
- context->drawContext(sk_ref_sp(rectangleTexture->asRenderTarget())));
+ context->drawContext(w, h, sk_ref_sp(rectangleTexture->asRenderTarget())));
if (!dc) {
ERRORF(reporter, "Could not get GrDrawContext for rectangle texture.");
return;
@@ -100,8 +103,6 @@ static void test_clear(skiatest::Reporter* reporter, GrContext* context,
GrColor color0 = GrColorPackRGBA(0xA, 0xB, 0xC, 0xD);
dc->clear(nullptr, color0, false);
- int w = rectangleTexture->width();
- int h = rectangleTexture->height();
int pixelCnt = w * h;
SkAutoTMalloc<uint32_t> expectedPixels(pixelCnt);
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698