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

Unified Diff: gm/texturedomaineffect.cpp

Issue 422123003: Adding repeat mode to texture domain (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 6 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 | « expectations/gm/ignored-tests.txt ('k') | src/effects/SkMatrixConvolutionImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/texturedomaineffect.cpp
diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp
index 37d256d1b7af33b8787604220d7a2f84865a659e..6cc979991002748ef20be74afc86e69f6870d96f 100644
--- a/gm/texturedomaineffect.cpp
+++ b/gm/texturedomaineffect.cpp
@@ -35,7 +35,10 @@ protected:
}
virtual SkISize onISize() SK_OVERRIDE {
- return SkISize::Make(400, 800);
+ const SkScalar canvasWidth = kDrawPad +
+ (kTargetWidth + 2 * kDrawPad) * GrTextureDomain::kModeCount +
+ kTestPad * GrTextureDomain::kModeCount;
+ return SkISize::Make(SkScalarCeilToInt(canvasWidth), 800);
}
virtual uint32_t onGetFlags() const SK_OVERRIDE {
@@ -44,7 +47,7 @@ protected:
}
virtual void onOnceBeforeDraw() SK_OVERRIDE {
- fBmp.allocN32Pixels(100, 100);
+ fBmp.allocN32Pixels(kTargetWidth, kTargetHeight);
SkCanvas canvas(fBmp);
canvas.clear(0x00000000);
SkPaint paint;
@@ -94,9 +97,6 @@ protected:
return;
}
- static const SkScalar kDrawPad = 10.f;
- static const SkScalar kTestPad = 10.f;
-
SkTArray<SkMatrix> textureMatrices;
textureMatrices.push_back().setIDiv(texture->width(), texture->height());
textureMatrices.push_back() = textureMatrices[0];
@@ -148,11 +148,19 @@ protected:
}
private:
+ static const SkScalar kDrawPad;
+ static const SkScalar kTestPad;
+ static const int kTargetWidth = 100;
+ static const int kTargetHeight = 100;
SkBitmap fBmp;
typedef GM INHERITED;
};
+// Windows builds did not like SkScalar initialization in class :(
+const SkScalar TextureDomainEffect::kDrawPad = 10.f;
+const SkScalar TextureDomainEffect::kTestPad = 10.f;
+
DEF_GM( return SkNEW(TextureDomainEffect); )
}
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/effects/SkMatrixConvolutionImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698