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

Unified Diff: src/core/SkDraw.cpp

Issue 1143173011: use pixmaps for dst in sprites -- NO BITMAPS (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add dox Created 5 years, 6 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/core/SkBlitter_Sprite.cpp ('k') | src/core/SkSpriteBlitter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 918885117cc801321cb4aed61847f0501caa550b..0ecc27d491622567cf72ed742d1bd938df2d38fd 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1280,9 +1280,13 @@ void SkDraw::drawBitmap(const SkBitmap& bitmap, const SkMatrix& prematrix,
int ix = SkScalarRoundToInt(matrix.getTranslateX());
int iy = SkScalarRoundToInt(matrix.getTranslateY());
if (clipHandlesSprite(*fRC, ix, iy, pmap)) {
+ SkPixmap dstPM;
+ if (!fBitmap->peekPixels(&dstPM)) {
+ return;
+ }
SkTBlitterAllocator allocator;
// blitter will be owned by the allocator.
- SkBlitter* blitter = SkBlitter::ChooseSprite(*fBitmap, paint, pmap, ix, iy, &allocator);
+ SkBlitter* blitter = SkBlitter::ChooseSprite(dstPM, paint, pmap, ix, iy, &allocator);
if (blitter) {
SkScan::FillIRect(SkIRect::MakeXYWH(ix, iy, pmap.width(), pmap.height()),
*fRC, blitter);
@@ -1337,9 +1341,13 @@ void SkDraw::drawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint& ori
const SkPixmap& pmap = unlocker.pixmap();
if (NULL == paint.getColorFilter() && clipHandlesSprite(*fRC, x, y, pmap)) {
+ SkPixmap dstPM;
+ if (!fBitmap->peekPixels(&dstPM)) {
+ return;
+ }
SkTBlitterAllocator allocator;
// blitter will be owned by the allocator.
- SkBlitter* blitter = SkBlitter::ChooseSprite(*fBitmap, paint, pmap, x, y, &allocator);
+ SkBlitter* blitter = SkBlitter::ChooseSprite(dstPM, paint, pmap, x, y, &allocator);
if (blitter) {
SkScan::FillIRect(bounds, *fRC, blitter);
return;
« no previous file with comments | « src/core/SkBlitter_Sprite.cpp ('k') | src/core/SkSpriteBlitter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698