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

Side by Side Diff: src/effects/gradients/SkGradientShaderPriv.h

Issue 207683004: Extract most of the mutable state of SkShader into a separate Context object. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 6 years, 9 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
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 SkGradientShaderPriv_DEFINED 8 #ifndef SkGradientShaderPriv_DEFINED
9 #define SkGradientShaderPriv_DEFINED 9 #define SkGradientShaderPriv_DEFINED
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 int fCount; 94 int fCount;
95 SkShader::TileMode fTileMode; 95 SkShader::TileMode fTileMode;
96 SkUnitMapper* fMapper; 96 SkUnitMapper* fMapper;
97 uint32_t fFlags; 97 uint32_t fFlags;
98 }; 98 };
99 99
100 public: 100 public:
101 SkGradientShaderBase(const Descriptor& desc); 101 SkGradientShaderBase(const Descriptor& desc);
102 virtual ~SkGradientShaderBase(); 102 virtual ~SkGradientShaderBase();
103 103
104 #if 0
104 virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK _OVERRIDE; 105 virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK _OVERRIDE;
105 virtual uint32_t getFlags() SK_OVERRIDE { return fFlags; } 106 virtual uint32_t getFlags() SK_OVERRIDE { return fFlags; }
107 #endif
108 virtual SkShader::Context* createContext(
109 const SkBitmap&, const SkPaint&, const SkMatrix&, void*) const SK_OV ERRIDE {
110 return NULL;
111 }
112 virtual size_t contextSize() const SK_OVERRIDE { return 0; }
106 virtual bool isOpaque() const SK_OVERRIDE; 113 virtual bool isOpaque() const SK_OVERRIDE;
107 114
108 void getGradientTableBitmap(SkBitmap*) const; 115 void getGradientTableBitmap(SkBitmap*) const;
109 116
110 enum { 117 enum {
111 /// Seems like enough for visual accuracy. TODO: if pos[] deserves 118 /// Seems like enough for visual accuracy. TODO: if pos[] deserves
112 /// it, use a larger cache. 119 /// it, use a larger cache.
113 kCache16Bits = 8, 120 kCache16Bits = 8,
114 kCache16Count = (1 << kCache16Bits), 121 kCache16Count = (1 << kCache16Bits),
115 kCache16Shift = 16 - kCache16Bits, 122 kCache16Shift = 16 - kCache16Bits,
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 GrGLUniformManager::UniformHandle fColorStartUni; 388 GrGLUniformManager::UniformHandle fColorStartUni;
382 GrGLUniformManager::UniformHandle fColorMidUni; 389 GrGLUniformManager::UniformHandle fColorMidUni;
383 GrGLUniformManager::UniformHandle fColorEndUni; 390 GrGLUniformManager::UniformHandle fColorEndUni;
384 391
385 typedef GrGLEffect INHERITED; 392 typedef GrGLEffect INHERITED;
386 }; 393 };
387 394
388 #endif 395 #endif
389 396
390 #endif 397 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698