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

Unified Diff: include/core/SkShader.h

Issue 1556003003: remove shadeSpan16 from shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup unused macro-generated procs Created 4 years, 11 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/SkBitmapProcShader.h » ('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 97160a4f2511f909d2c8adc0f8ed3484287d22ac..4d3ac5c9efdd59116974ad202d936574c43a922c 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -72,31 +72,14 @@ public:
enum Flags {
//!< set if all of the colors will be opaque
- kOpaqueAlpha_Flag = 0x01,
-
- //! set if this shader's shadeSpan16() method can be called
- kHasSpan16_Flag = 0x02,
-
- /** Set this bit if the shader's native data type is instrinsically 16
- bit, meaning that calling the 32bit shadeSpan() entry point will
- mean the the impl has to up-sample 16bit data into 32bit. Used as a
- a means of clearing a dither request if the it will have no effect
- */
- kIntrinsicly16_Flag = 0x04,
+ kOpaqueAlpha_Flag = 1 << 0,
/** set if the spans only vary in X (const in Y).
e.g. an Nx1 bitmap that is being tiled in Y, or a linear-gradient
that varies from left-to-right. This flag specifies this for
shadeSpan().
*/
- kConstInY32_Flag = 0x08,
-
- /** same as kConstInY32_Flag, but is set if this is true for shadeSpan16
- which may not always be the case, since shadeSpan16 may be
- predithered, which would mean it was not const in Y, even though
- the 32bit shadeSpan() would be const.
- */
- kConstInY16_Flag = 0x10
+ kConstInY32_Flag = 1 << 1,
};
/**
@@ -137,12 +120,6 @@ public:
virtual uint32_t getFlags() const { return 0; }
/**
- * Return the alpha associated with the data returned by shadeSpan16(). If
- * kHasSpan16_Flag is not set, this value is meaningless.
- */
- virtual uint8_t getSpan16Alpha() const { return fPaintAlpha; }
-
- /**
* Called for each span of the object being drawn. Your subclass should
* set the appropriate colors (with premultiplied alpha) that correspond
* to the specified device coordinates.
@@ -157,26 +134,12 @@ public:
virtual ShadeProc asAShadeProc(void** ctx);
/**
- * Called only for 16bit devices when getFlags() returns
- * kOpaqueAlphaFlag | kHasSpan16_Flag
- */
- virtual void shadeSpan16(int x, int y, uint16_t[], int count);
-
- /**
* Similar to shadeSpan, but only returns the alpha-channel for a span.
* The default implementation calls shadeSpan() and then extracts the alpha
* values from the returned colors.
*/
virtual void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count);
- /**
- * Helper function that returns true if this shader's shadeSpan16() method
- * can be called.
- */
- bool canCallShadeSpan16() {
- return SkShader::CanCallShadeSpan16(this->getFlags());
- }
-
// Notification from blitter::blitMask in case we need to see the non-alpha channels
virtual void set3DMask(const SkMask*) {}
@@ -220,13 +183,6 @@ public:
virtual size_t contextSize() const;
/**
- * Helper to check the flags to know if it is legal to call shadeSpan16()
- */
- static bool CanCallShadeSpan16(uint32_t flags) {
- return (flags & kHasSpan16_Flag) != 0;
- }
-
- /**
* Returns true if this shader is just a bitmap, and if not null, returns the bitmap,
* localMatrix, and tilemodes. If this is not a bitmap, returns false and ignores the
* out-parameters.
« no previous file with comments | « no previous file | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698