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

Unified Diff: include/core/SkShader.h

Issue 1793883002: add blitprocs to shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | src/core/SkBlitter_PM4f.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkShader.h
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 8002f630c4e9e1482d66d5d7841d1db09e72c860..39ffd86f3a369d9c31c177cb640e1779e9c09104 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -142,6 +142,18 @@ public:
virtual void shadeSpan4f(int x, int y, SkPM4f[], int count);
+ struct BlitState {
+ Context* fCtx;
+ SkXfermode* fXfer;
+ enum { N = 2 };
+ void* fStorage[N];
+ };
+ typedef void (*BlitProc)(BlitState*,
+ int x, int y, const SkPixmap&, int count, const SkAlpha[]);
+ BlitProc chooseBlitProc(const SkImageInfo& info, BlitState* state) {
+ return this->onChooseBlitProc(info, state);
+ }
+
/**
* The const void* ctx is only const because all the implementations are const.
* This can be changed to non-const if a new shade proc needs to change the ctx.
@@ -175,6 +187,11 @@ public:
const SkMatrix& getTotalInverse() const { return fTotalInverse; }
MatrixClass getInverseClass() const { return (MatrixClass)fTotalInverseClass; }
const SkMatrix& getCTM() const { return fCTM; }
+
+ virtual BlitProc onChooseBlitProc(const SkImageInfo&, BlitState*) {
+ return nullptr;
+ }
+
private:
SkMatrix fCTM;
SkMatrix fTotalInverse;
« no previous file with comments | « no previous file | src/core/SkBlitter_PM4f.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698