diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-17 21:09:49 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-17 21:09:49 +0000 |
commit | 53783b026a00683c1fb504127c3398dabb61ea73 (patch) | |
tree | 0dd91705720040c78d85b26e1cd3c082fa822db2 /src/core/SkCoreBlitters.h | |
parent | ec2d8b37b069a9871cf2228f1ff83f8d70628cab (diff) |
Revert of Extract most of the mutable state of SkShader into a separate Context object. (https://codereview.chromium.org/207683004/)
Reason for revert:
Causing memory leaks in Chromium.
Original issue's description:
> Extract most of the mutable state of SkShader into a separate Context object.
>
> SkShader currently stores some state during draw calls via setContext(...).
> Move that mutable state into a separate SkShader::Context class that is
> constructed on demand for the duration of the draw.
>
> Calls to setContext() are replaced with createContext() which returns a context
> corresponding to the shader object or NULL if the parameters to createContext
> are invalid.
>
> TEST=out/Debug/dm
> BUG=skia:1976
>
> Committed: http://code.google.com/p/skia/source/detail?r=14216
R=scroggo@google.com, skyostil@chromium.org, tomhudson@chromium.org, senorblanco@chromium.org, reed@google.com, dominikg@chromium.org
TBR=dominikg@chromium.org, reed@google.com, scroggo@google.com, senorblanco@chromium.org, skyostil@chromium.org, tomhudson@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:1976
Author: bungeman@google.com
Review URL: https://codereview.chromium.org/241283003
git-svn-id: http://skia.googlecode.com/svn/trunk@14247 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkCoreBlitters.h')
-rw-r--r-- | src/core/SkCoreBlitters.h | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/src/core/SkCoreBlitters.h b/src/core/SkCoreBlitters.h index 2d22d38e78..285184050b 100644 --- a/src/core/SkCoreBlitters.h +++ b/src/core/SkCoreBlitters.h @@ -27,29 +27,12 @@ private: class SkShaderBlitter : public SkRasterBlitter { public: - /** - * The storage for shaderContext is owned by the caller, but the object itself is not. - * The blitter only ensures that the storage always holds a live object, but it may - * exchange that object. - */ - SkShaderBlitter(const SkBitmap& device, const SkPaint& paint, - SkShader::Context* shaderContext); + SkShaderBlitter(const SkBitmap& device, const SkPaint& paint); virtual ~SkShaderBlitter(); - /** - * Create a new shader context and uses it instead of the old one if successful. - * Will create the context at the same location as the old one (this is safe - * because the shader itself is unchanged). - */ - virtual bool resetShaderContext(const SkBitmap& device, const SkPaint& paint, - const SkMatrix& matrix) SK_OVERRIDE; - - virtual SkShader::Context* getShaderContext() const SK_OVERRIDE { return fShaderContext; } - protected: - uint32_t fShaderFlags; - const SkShader* fShader; - SkShader::Context* fShaderContext; + uint32_t fShaderFlags; + SkShader* fShader; private: // illegal @@ -92,8 +75,7 @@ private: class SkA8_Shader_Blitter : public SkShaderBlitter { public: - SkA8_Shader_Blitter(const SkBitmap& device, const SkPaint& paint, - SkShader::Context* shaderContext); + SkA8_Shader_Blitter(const SkBitmap& device, const SkPaint& paint); virtual ~SkA8_Shader_Blitter(); virtual void blitH(int x, int y, int width); virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]); @@ -159,8 +141,7 @@ private: class SkARGB32_Shader_Blitter : public SkShaderBlitter { public: - SkARGB32_Shader_Blitter(const SkBitmap& device, const SkPaint& paint, - SkShader::Context* shaderContext); + SkARGB32_Shader_Blitter(const SkBitmap& device, const SkPaint& paint); virtual ~SkARGB32_Shader_Blitter(); virtual void blitH(int x, int y, int width) SK_OVERRIDE; virtual void blitV(int x, int y, int height, SkAlpha alpha) SK_OVERRIDE; @@ -198,7 +179,6 @@ private: */ SkBlitter* SkBlitter_ChooseD565(const SkBitmap& device, const SkPaint& paint, - SkShader::Context* shaderContext, SkTBlitterAllocator* allocator); #endif |