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

Unified Diff: src/gpu/GrRecordReplaceDraw.cpp

Issue 1422703009: Revert[4] of "stop using drawSprite (at least w/ no filters) as it is going away" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/SkMergeImageFilter.cpp ('k') | src/images/SkImageDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrRecordReplaceDraw.cpp
diff --git a/src/gpu/GrRecordReplaceDraw.cpp b/src/gpu/GrRecordReplaceDraw.cpp
index bca92558567cb8438ae6e0406bfe084cdd815840..28f27dfc1c7821642a18a3f2050e8954a7a71a21 100644
--- a/src/gpu/GrRecordReplaceDraw.cpp
+++ b/src/gpu/GrRecordReplaceDraw.cpp
@@ -35,22 +35,22 @@ static inline void draw_replacement_bitmap(GrCachedLayer* layer, SkCanvas* canva
!layer->isAtlased() ? layer->rect().height() : layer->texture()->height(),
&bm);
+ canvas->save();
+ canvas->setMatrix(SkMatrix::I());
if (layer->isAtlased()) {
const SkRect src = SkRect::Make(layer->rect());
const SkRect dst = SkRect::Make(layer->srcIR());
SkASSERT(layer->offset().isZero());
- canvas->save();
- canvas->setMatrix(SkMatrix::I());
canvas->drawBitmapRect(bm, src, dst, layer->paint(), SkCanvas::kStrict_SrcRectConstraint);
- canvas->restore();
} else {
- canvas->drawSprite(bm,
- layer->srcIR().fLeft + layer->offset().fX,
- layer->srcIR().fTop + layer->offset().fY,
+ canvas->drawBitmap(bm,
+ SkIntToScalar(layer->srcIR().fLeft + layer->offset().fX),
+ SkIntToScalar(layer->srcIR().fTop + layer->offset().fY),
layer->paint());
}
+ canvas->restore();
}
// Used by GrRecordReplaceDraw. It intercepts nested drawPicture calls and
« no previous file with comments | « src/effects/SkMergeImageFilter.cpp ('k') | src/images/SkImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698