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

Unified Diff: include/core/SkCanvas.h

Issue 1261433009: Refugee from Dead Machine 11: Add SkCanvas::drawLitAtlas call Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 8 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 | « gyp/libjpeg-turbo.gyp ('k') | include/core/SkDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 6a88d6832277dcbe57c1951224a28640a49b0145..486bc1681edcbf8ab0c9f90793d43f328bde98b1 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -27,6 +27,7 @@ class SkDrawable;
class SkDrawFilter;
class SkImage;
class SkImageFilter;
+class SkLight;
class SkMetaData;
class SkPath;
class SkPicture;
@@ -1088,6 +1089,18 @@ public:
}
/**
+ * Like drawAtlas, drawLitAtlas draws a set of sprites from the atlas. Each
+ * sprite must have two sets of texture rectangles however. One for its
+ * diffuse channel and the second for its normal map both of which are in
+ * the atlas. The normal-mapped sprite is lit by the specified lights.
+ */
+ void drawLitAtlas(const SkImage* atlas, const SkRSXform xforms[],
+ const SkRect diffTex[], const SkRect normTex[],
+ const SkColor colors[], int count, SkXfermode::Mode,
+ const SkRect* cullRect, const SkPaint* paint,
+ const SkLight lights[], int numLights);
+
+ /**
* Draw the contents of this drawable into the canvas. If the canvas is async
* (e.g. it is recording into a picture) then the drawable will be referenced instead,
* to have its draw() method called when the picture is finalized.
@@ -1273,6 +1286,10 @@ protected:
virtual void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
int count, SkXfermode::Mode, const SkRect* cull, const SkPaint*);
+ virtual void onDrawLitAtlas(const SkImage*, const SkRSXform[],
+ const SkRect diffTex[], const SkRect normTex[], const SkColor[],
+ int count, SkXfermode::Mode, const SkRect* cull, const SkPaint*,
+ const SkLight lights[], int numLights);
virtual void onDrawPath(const SkPath&, const SkPaint&);
virtual void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkPaint*);
virtual void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPaint*,
« no previous file with comments | « gyp/libjpeg-turbo.gyp ('k') | include/core/SkDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698