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

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

Issue 264843006: create struct to hold all the params passed around for shader::context (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address review comments 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 SkBitmap&, const SkPaint&, 20 virtual bool validContext(const ContextRec&, SkMatrix* totalInverse) const S K_OVERRIDE;
21 const SkMatrix&, SkMatrix* totalInverse = NULL) co nst SK_OVERRIDE; 21 virtual SkShader::Context* createContext(const ContextRec&, void* storage) c onst SK_OVERRIDE;
22 virtual SkShader::Context* createContext(const SkBitmap&, const SkPaint&,
23 const SkMatrix&, void* storage) con st SK_OVERRIDE;
24 virtual size_t contextSize() const SK_OVERRIDE; 22 virtual size_t contextSize() const SK_OVERRIDE;
25 23
26 class FilterShaderContext : public SkShader::Context { 24 class FilterShaderContext : public SkShader::Context {
27 public: 25 public:
28 // Takes ownership of shaderContext and calls its destructor. 26 // Takes ownership of shaderContext and calls its destructor.
29 FilterShaderContext(const SkFilterShader& filterShader, SkShader::Contex t* shaderContext, 27 FilterShaderContext(const SkFilterShader&, SkShader::Context*, const Con textRec&);
30 const SkBitmap& device, const SkPaint& paint, const SkMatrix& matrix);
31 virtual ~FilterShaderContext(); 28 virtual ~FilterShaderContext();
32 29
33 virtual uint32_t getFlags() const SK_OVERRIDE; 30 virtual uint32_t getFlags() const SK_OVERRIDE;
34 31
35 virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE ; 32 virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE ;
36 virtual void shadeSpan16(int x, int y, uint16_t[], int count) SK_OVERRID E; 33 virtual void shadeSpan16(int x, int y, uint16_t[], int count) SK_OVERRID E;
37 34
38 private: 35 private:
39 SkShader::Context* fShaderContext; 36 SkShader::Context* fShaderContext;
40 37
41 typedef SkShader::Context INHERITED; 38 typedef SkShader::Context INHERITED;
42 }; 39 };
43 40
44 SK_TO_STRING_OVERRIDE() 41 SK_TO_STRING_OVERRIDE()
45 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkFilterShader) 42 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkFilterShader)
46 43
47 protected: 44 protected:
48 SkFilterShader(SkReadBuffer& ); 45 SkFilterShader(SkReadBuffer& );
49 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 46 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
50 47
51 private: 48 private:
52 SkShader* fShader; 49 SkShader* fShader;
53 SkColorFilter* fFilter; 50 SkColorFilter* fFilter;
54 51
55 typedef SkShader INHERITED; 52 typedef SkShader INHERITED;
56 }; 53 };
57 54
58 #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