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

Side by Side Diff: src/core/SkFilterShader.h

Issue 261773005: Remove SkShader virtual method validContext (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: correctly call shaderA/B in composeshader Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkFilterShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkFilterShader_DEFINED 8 #ifndef SkFilterShader_DEFINED
9 #define SkFilterShader_DEFINED 9 #define SkFilterShader_DEFINED
10 10
11 #include "SkShader.h" 11 #include "SkShader.h"
12 12
13 class SkColorFilter; 13 class SkColorFilter;
14 14
15 class SkFilterShader : public SkShader { 15 class SkFilterShader : public SkShader {
16 public: 16 public:
17 SkFilterShader(SkShader* shader, SkColorFilter* filter); 17 SkFilterShader(SkShader* shader, SkColorFilter* filter);
18 virtual ~SkFilterShader(); 18 virtual ~SkFilterShader();
19 19
20 virtual bool validContext(const ContextRec&, SkMatrix* totalInverse) const S K_OVERRIDE;
21 virtual SkShader::Context* createContext(const ContextRec&, void* storage) c onst SK_OVERRIDE;
22 virtual size_t contextSize() const SK_OVERRIDE; 20 virtual size_t contextSize() const SK_OVERRIDE;
23 21
24 class FilterShaderContext : public SkShader::Context { 22 class FilterShaderContext : public SkShader::Context {
25 public: 23 public:
26 // Takes ownership of shaderContext and calls its destructor. 24 // Takes ownership of shaderContext and calls its destructor.
27 FilterShaderContext(const SkFilterShader&, SkShader::Context*, const Con textRec&); 25 FilterShaderContext(const SkFilterShader&, SkShader::Context*, const Con textRec&);
28 virtual ~FilterShaderContext(); 26 virtual ~FilterShaderContext();
29 27
30 virtual uint32_t getFlags() const SK_OVERRIDE; 28 virtual uint32_t getFlags() const SK_OVERRIDE;
31 29
32 virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE ; 30 virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE ;
33 virtual void shadeSpan16(int x, int y, uint16_t[], int count) SK_OVERRID E; 31 virtual void shadeSpan16(int x, int y, uint16_t[], int count) SK_OVERRID E;
34 32
35 private: 33 private:
36 SkShader::Context* fShaderContext; 34 SkShader::Context* fShaderContext;
37 35
38 typedef SkShader::Context INHERITED; 36 typedef SkShader::Context INHERITED;
39 }; 37 };
40 38
41 SK_TO_STRING_OVERRIDE() 39 SK_TO_STRING_OVERRIDE()
42 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkFilterShader) 40 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkFilterShader)
43 41
44 protected: 42 protected:
45 SkFilterShader(SkReadBuffer& ); 43 SkFilterShader(SkReadBuffer& );
46 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 44 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
45 virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_ OVERRIDE;
46
47 47
48 private: 48 private:
49 SkShader* fShader; 49 SkShader* fShader;
50 SkColorFilter* fFilter; 50 SkColorFilter* fFilter;
51 51
52 typedef SkShader INHERITED; 52 typedef SkShader INHERITED;
53 }; 53 };
54 54
55 #endif 55 #endif
OLDNEW
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkFilterShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698