diff options
author | Android Chromium Automerger <chromium-automerger@android> | 2014-05-05 23:55:06 +0000 |
---|---|---|
committer | Android Chromium Automerger <chromium-automerger@android> | 2014-05-05 23:55:06 +0000 |
commit | fe1bfbf8bcc440a04ca20051e75f95a411e36bf8 (patch) | |
tree | 24995edc18f8984712ddc398c332ec17e2901b1d | |
parent | b9f56bb9959a89e569bddee9bc6871cdecd05d32 (diff) | |
parent | 08a3eed60c27d0ab0e3059769a4b3470435bd348 (diff) | |
download | include-fe1bfbf8bcc440a04ca20051e75f95a411e36bf8.tar.gz |
Merge third_party/skia/include from https://chromium.googlesource.com/external/skia/include.git at 08a3eed60c27d0ab0e3059769a4b3470435bd348
This commit was generated by merge_from_chromium.py.
Change-Id: Ic20e392150c3f7a9604815f06ad08372652c7520
-rw-r--r-- | core/SkColorShader.h | 3 | ||||
-rw-r--r-- | core/SkComposeShader.h | 3 | ||||
-rw-r--r-- | core/SkEmptyShader.h | 18 | ||||
-rw-r--r-- | core/SkShader.h | 30 | ||||
-rw-r--r-- | effects/SkPerlinNoiseShader.h | 2 | ||||
-rw-r--r-- | effects/SkTransparentShader.h | 5 |
6 files changed, 27 insertions, 34 deletions
diff --git a/core/SkColorShader.h b/core/SkColorShader.h index f993959..be59627 100644 --- a/core/SkColorShader.h +++ b/core/SkColorShader.h @@ -27,8 +27,6 @@ public: virtual bool isOpaque() const SK_OVERRIDE; - virtual SkShader::Context* createContext(const ContextRec&, void* storage) const SK_OVERRIDE; - virtual size_t contextSize() const SK_OVERRIDE { return sizeof(ColorShaderContext); } @@ -64,6 +62,7 @@ public: protected: SkColorShader(SkReadBuffer&); virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; + virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE; private: SkColor fColor; // ignored if fInheritColor is true diff --git a/core/SkComposeShader.h b/core/SkComposeShader.h index ac3c32b..cfb03b9 100644 --- a/core/SkComposeShader.h +++ b/core/SkComposeShader.h @@ -34,8 +34,6 @@ public: SkComposeShader(SkShader* sA, SkShader* sB, SkXfermode* mode = NULL); virtual ~SkComposeShader(); - virtual bool validContext(const ContextRec&, SkMatrix* totalInverse = NULL) const SK_OVERRIDE; - virtual SkShader::Context* createContext(const ContextRec&, void*) const SK_OVERRIDE; virtual size_t contextSize() const SK_OVERRIDE; class ComposeShaderContext : public SkShader::Context { @@ -70,6 +68,7 @@ public: protected: SkComposeShader(SkReadBuffer& ); virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; + virtual Context* onCreateContext(const ContextRec&, void*) const SK_OVERRIDE; private: SkShader* fShaderA; diff --git a/core/SkEmptyShader.h b/core/SkEmptyShader.h index d1a067f..7de3bc1 100644 --- a/core/SkEmptyShader.h +++ b/core/SkEmptyShader.h @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -6,13 +5,13 @@ * found in the LICENSE file. */ - - #ifndef SkEmptyShader_DEFINED #define SkEmptyShader_DEFINED #include "SkShader.h" +// TODO: move this to private, as there is a public factory on SkShader + /** * \class SkEmptyShader * A Shader that always draws nothing. Its createContext always returns NULL. @@ -27,21 +26,16 @@ public: return sizeof(SkShader::Context); } - virtual bool validContext(const ContextRec&, SkMatrix* totalInverse = NULL) const SK_OVERRIDE { - return false; - } - - virtual SkShader::Context* createContext(const ContextRec&, void*) const SK_OVERRIDE { - // validContext returns false. - return NULL; - } - SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmptyShader) protected: SkEmptyShader(SkReadBuffer& buffer) : INHERITED(buffer) {} + virtual SkShader::Context* onCreateContext(const ContextRec&, void*) const SK_OVERRIDE { + return NULL; + } + private: typedef SkShader INHERITED; }; diff --git a/core/SkShader.h b/core/SkShader.h index bcb229d..0417306 100644 --- a/core/SkShader.h +++ b/core/SkShader.h @@ -213,20 +213,10 @@ public: }; /** - * Subclasses should be sure to call their INHERITED::validContext() if - * they override this method. - */ - virtual bool validContext(const ContextRec&, SkMatrix* totalInverse = NULL) const; - - /** * Create the actual object that does the shading. - * Returns NULL if validContext() returns false. * Size of storage must be >= contextSize. - * Your subclass must also override contextSize() if it overrides createContext(). - * - * Base class implementation returns NULL. */ - virtual Context* createContext(const ContextRec&, void* storage) const; + Context* createContext(const ContextRec&, void* storage) const; /** * Return the size of a Context returned by createContext. @@ -374,6 +364,11 @@ public: ////////////////////////////////////////////////////////////////////////// // Factory methods for stock shaders + /** + * Call this to create a new "empty" shader, that will not draw anything. + */ + static SkShader* CreateEmptyShader(); + /** Call this to create a new shader that will draw with the specified bitmap. * * If the bitmap cannot be used (e.g. has no pixels, or its dimensions @@ -409,14 +404,19 @@ public: SK_DEFINE_FLATTENABLE_TYPE(SkShader) protected: - SkShader(SkReadBuffer& ); virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; -private: - SkMatrix fLocalMatrix; + bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; + + /** + * Your subclass must also override contextSize() if it overrides onCreateContext(). + * Base class impl returns NULL. + */ + virtual Context* onCreateContext(const ContextRec&, void* storage) const; - bool computeTotalInverse(const SkMatrix& matrix, SkMatrix* totalInverse) const; +private: + SkMatrix fLocalMatrix; typedef SkFlattenable INHERITED; }; diff --git a/effects/SkPerlinNoiseShader.h b/effects/SkPerlinNoiseShader.h index 2766df0..5082a07 100644 --- a/effects/SkPerlinNoiseShader.h +++ b/effects/SkPerlinNoiseShader.h @@ -72,7 +72,6 @@ public: } - virtual SkShader::Context* createContext(const ContextRec&, void* storage) const SK_OVERRIDE; virtual size_t contextSize() const SK_OVERRIDE; class PerlinNoiseShaderContext : public SkShader::Context { @@ -104,6 +103,7 @@ public: protected: SkPerlinNoiseShader(SkReadBuffer&); virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; + virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE; private: SkPerlinNoiseShader(SkPerlinNoiseShader::Type type, SkScalar baseFrequencyX, diff --git a/effects/SkTransparentShader.h b/effects/SkTransparentShader.h index 55513eb..d9a3e5d 100644 --- a/effects/SkTransparentShader.h +++ b/effects/SkTransparentShader.h @@ -14,8 +14,6 @@ class SK_API SkTransparentShader : public SkShader { public: SkTransparentShader() {} - virtual SkShader::Context* createContext(const ContextRec&, void* storage) const - SK_OVERRIDE; virtual size_t contextSize() const SK_OVERRIDE; class TransparentShaderContext : public SkShader::Context { @@ -36,6 +34,9 @@ public: SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTransparentShader) +protected: + virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE; + private: SkTransparentShader(SkReadBuffer& buffer) : INHERITED(buffer) {} |