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

Unified Diff: tests/ClipBoundsTest.cpp

Issue 1929833004: Revert of Refactor drawContext/RenderTarget creation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 | « tests/ClearTest.cpp ('k') | tests/PrimitiveProcessorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ClipBoundsTest.cpp
diff --git a/tests/ClipBoundsTest.cpp b/tests/ClipBoundsTest.cpp
index 5660afdc27aa2cdb00b422509230113d3cbb1792..abdd3f44fa1e4e3b1d36fda9bdf2aa5fd6c28779 100644
--- a/tests/ClipBoundsTest.cpp
+++ b/tests/ClipBoundsTest.cpp
@@ -17,8 +17,20 @@
static const int kXSize = 100;
static const int kYSize = 100;
- const SkIRect intScreen = SkIRect::MakeWH(kXSize, kYSize);
- const SkRect screen = SkRect::Make(intScreen);
+ GrSurfaceDesc desc;
+ desc.fFlags = kRenderTarget_GrSurfaceFlag;
+ desc.fConfig = kAlpha_8_GrPixelConfig;
+ desc.fWidth = kXSize;
+ desc.fHeight = kYSize;
+
+ SkAutoTUnref<GrTexture> texture(
+ ctxInfo.fGrContext->textureProvider()->createTexture(desc, SkBudgeted::kYes, nullptr, 0));
+ if (!texture) {
+ return;
+ }
+
+ SkIRect intScreen = SkIRect::MakeWH(kXSize, kYSize);
+ SkRect screen = SkRect::Make(intScreen);
SkRect clipRect(screen);
clipRect.outset(10, 10);
@@ -44,7 +56,7 @@
clipData.setClipStack(&stack);
SkIRect devGrClipBound;
- clipData.getConservativeBounds(kXSize, kYSize,
+ clipData.getConservativeBounds(texture->width(), texture->height(),
&devGrClipBound,
&isIntersectionOfRects);
« no previous file with comments | « tests/ClearTest.cpp ('k') | tests/PrimitiveProcessorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698