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

Unified Diff: src/effects/SkTileImageFilter.cpp

Issue 2366723004: Revert of Create special surfaces according to original device (not always in N32) (Closed)
Patch Set: Created 4 years, 3 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/effects/SkPictureImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkTileImageFilter.cpp
diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp
index 46c4d9af678948db7513a34ecb9766213b984bbe..c098bc29550a8d7a185d23eba34f2678dfdbc80d 100644
--- a/src/effects/SkTileImageFilter.cpp
+++ b/src/effects/SkTileImageFilter.cpp
@@ -55,7 +55,9 @@
}
const SkIRect dstIRect = dstRect.roundOut();
- if (!fSrcRect.width() || !fSrcRect.height() || !dstIRect.width() || !dstIRect.height()) {
+ int dstWidth = dstIRect.width();
+ int dstHeight = dstIRect.height();
+ if (!fSrcRect.width() || !fSrcRect.height() || !dstWidth || !dstHeight) {
return nullptr;
}
@@ -78,7 +80,9 @@
return nullptr;
}
} else {
- sk_sp<SkSurface> surf(input->makeTightSurface(ctx.outputProperties(), srcIRect.size()));
+ const SkImageInfo info = SkImageInfo::MakeN32(srcIRect.width(), srcIRect.height(),
+ kPremul_SkAlphaType);
+ sk_sp<SkSurface> surf(input->makeTightSurface(info));
if (!surf) {
return nullptr;
}
@@ -98,7 +102,9 @@
SkASSERT(subset->width() == srcIRect.width());
SkASSERT(subset->height() == srcIRect.height());
- sk_sp<SkSpecialSurface> surf(source->makeSurface(ctx.outputProperties(), dstIRect.size()));
+ const SkImageInfo info = SkImageInfo::MakeN32(dstWidth, dstHeight, kPremul_SkAlphaType);
+
+ sk_sp<SkSpecialSurface> surf(source->makeSurface(info));
if (!surf) {
return nullptr;
}
« no previous file with comments | « src/effects/SkPictureImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698