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

Unified Diff: tests/BlitRowTest.cpp

Issue 2195893002: Always return ImageShader, even from SkShader::MakeBitmapShader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update serialize-8888 ignore list: skbug.com/5595 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
Index: tests/BlitRowTest.cpp
diff --git a/tests/BlitRowTest.cpp b/tests/BlitRowTest.cpp
index 032acdac3942b0ba658fa933704c0103184d6ad5..99b79217e0689ea6c3056de1d61cd850d2641d5c 100644
--- a/tests/BlitRowTest.cpp
+++ b/tests/BlitRowTest.cpp
@@ -195,19 +195,11 @@ static void test_diagonal(skiatest::Reporter* reporter) {
};
static const SkColor gDstBG[] = { 0, 0xFFFFFFFF };
-
- SkPaint paint;
+ const SkRect srcR = SkRect::MakeIWH(W, H);
SkBitmap srcBM;
srcBM.allocN32Pixels(W, H);
- SkRect srcR = {
- 0, 0, SkIntToScalar(srcBM.width()), SkIntToScalar(srcBM.height()) };
-
- // cons up a mesh to draw the bitmap with
- Mesh mesh(srcBM, &paint);
-
- SkImageInfo info = SkImageInfo::Make(W, H, kUnknown_SkColorType,
- kPremul_SkAlphaType);
+ SkImageInfo info = SkImageInfo::Make(W, H, kUnknown_SkColorType, kPremul_SkAlphaType);
for (size_t i = 0; i < SK_ARRAY_COUNT(gDstColorType); i++) {
info = info.makeColorType(gDstColorType[i]);
@@ -224,7 +216,10 @@ static void test_diagonal(skiatest::Reporter* reporter) {
bgColor = gDstBG[j];
for (int c = 0; c <= 0xFF; c++) {
+ // cons up a mesh to draw the bitmap with
+ SkPaint paint;
srcBM.eraseARGB(0xFF, c, c, c);
+ Mesh mesh(srcBM, &paint);
for (int k = 0; k < 4; k++) {
bool dither = (k & 1) != 0;

Powered by Google App Engine
This is Rietveld 408576698