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

Unified Diff: include/core/SkShader.h

Issue 1530743002: Fix UB function problems for shaders and mask. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix 16-bit masks Created 5 years 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/SkBitmapProcShader.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 34cb648022ca25593943ba054f7d196ad2c26bc2..9b48697d20ae4e673951dfb351cba7a714782abb 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -149,7 +149,11 @@ public:
*/
virtual void shadeSpan(int x, int y, SkPMColor[], int count) = 0;
- typedef void (*ShadeProc)(void* ctx, int x, int y, SkPMColor[], int count);
+ /**
+ * 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.
+ */
+ typedef void (*ShadeProc)(const void* ctx, int x, int y, SkPMColor[], int count);
virtual ShadeProc asAShadeProc(void** ctx);
/**
« no previous file with comments | « no previous file | src/core/SkBitmapProcShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698