aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ClipBoundsTest.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-04-28 06:21:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-28 06:21:55 -0700
commitaa19a5fbc58e372df11443c90a25f02a04ecef52 (patch)
tree4c6f03988d11d06477e9cedae7fda5d44dfcc650 /tests/ClipBoundsTest.cpp
parentb8498825b54718cdd90c30c39323cfc433695f23 (diff)
Revert of Refactor drawContext/RenderTarget creation (patchset #8 id:140001 of https://codereview.chromium.org/1914883002/ )
Reason for revert: Experimental revert to see if this is blocking the DEPS roll. Original issue's description: > Refactor drawContext/RenderTarget creation > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1914883002 > > Committed: https://skia.googlesource.com/skia/+/2f1c42e8448bbbadeb3df1c626faa90aa33f8907 TBR=bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1929833004
Diffstat (limited to 'tests/ClipBoundsTest.cpp')
-rw-r--r--tests/ClipBoundsTest.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/ClipBoundsTest.cpp b/tests/ClipBoundsTest.cpp
index 5660afdc27..abdd3f44fa 100644
--- a/tests/ClipBoundsTest.cpp
+++ b/tests/ClipBoundsTest.cpp
@@ -17,8 +17,20 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrClipBounds, reporter, ctxInfo) {
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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrClipBounds, reporter, ctxInfo) {
clipData.setClipStack(&stack);
SkIRect devGrClipBound;
- clipData.getConservativeBounds(kXSize, kYSize,
+ clipData.getConservativeBounds(texture->width(), texture->height(),
&devGrClipBound,
&isIntersectionOfRects);