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

Unified Diff: src/utils/SkDeferredCanvas.cpp

Issue 1181913003: add SkCanvas::drawAtlas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix warnings 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/pipe/SkGPipeWrite.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDeferredCanvas.cpp
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index 5b6a06863a0faa1df1f697b7374c1f0f5b6f8b28..ccf0b012b12d29323df2e621800872b37cdaa669 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -251,6 +251,10 @@ protected:
const SkPoint texCoords[4], SkXfermode* xmode,
const SkPaint& paint) override
{SkASSERT(0);}
+ void drawAtlas(const SkDraw&, const SkImage* atlas, const SkRSXform[], const SkRect[],
+ const SkColor[], int count, SkXfermode::Mode, const SkPaint&) override
+ {SkASSERT(0);}
+
void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
const SkPaint&) override
{SkASSERT(0);}
@@ -356,8 +360,7 @@ bool SkDeferredDevice::hasPendingCommands() {
return fPipeController.hasPendingCommands();
}
-void SkDeferredDevice::aboutToDraw()
-{
+void SkDeferredDevice::aboutToDraw() {
if (fNotificationClient) {
fNotificationClient->prepareForDraw();
}
@@ -989,6 +992,15 @@ void SkDeferredCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor color
this->recordedDrawCommand();
}
+void SkDeferredCanvas::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[],
+ const SkRect tex[], const SkColor colors[], int count,
+ SkXfermode::Mode mode, const SkRect* cullRect,
+ const SkPaint* paint) {
+ AutoImmediateDrawIfNeeded autoDraw(*this, paint);
+ this->drawingCanvas()->drawAtlas(atlas, xform, tex, colors, count, mode, cullRect, paint);
+ this->recordedDrawCommand();
+}
+
SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
this->drawingCanvas()->setDrawFilter(filter);
this->INHERITED::setDrawFilter(filter);
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698