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/SkLocalMatrixShader.h

Issue 1309943004: Revert of switch to isABitmap, deprecate SK_SUPPORT_LEGACY_SHADERBITMAPTYPE (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/core/SkShader.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 2014 Google Inc. 2 * Copyright 2014 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 SkLocalMatrixShader_DEFINED 8 #ifndef SkLocalMatrixShader_DEFINED
9 #define SkLocalMatrixShader_DEFINED 9 #define SkLocalMatrixShader_DEFINED
10 10
11 #include "SkShader.h" 11 #include "SkShader.h"
12 #include "SkReadBuffer.h" 12 #include "SkReadBuffer.h"
13 #include "SkWriteBuffer.h" 13 #include "SkWriteBuffer.h"
14 14
15 class SkLocalMatrixShader : public SkShader { 15 class SkLocalMatrixShader : public SkShader {
16 public: 16 public:
17 SkLocalMatrixShader(SkShader* proxy, const SkMatrix& localMatrix) 17 SkLocalMatrixShader(SkShader* proxy, const SkMatrix& localMatrix)
18 : INHERITED(&localMatrix) 18 : INHERITED(&localMatrix)
19 , fProxyShader(SkRef(proxy)) 19 , fProxyShader(SkRef(proxy))
20 {} 20 {}
21 21
22 size_t contextSize() const override { 22 size_t contextSize() const override {
23 return fProxyShader->contextSize(); 23 return fProxyShader->contextSize();
24 } 24 }
25 25
26 virtual BitmapType asABitmap(SkBitmap* bitmap, SkMatrix* matrix,
27 TileMode* mode) const override {
28 return fProxyShader->asABitmap(bitmap, matrix, mode);
29 }
30
26 GradientType asAGradient(GradientInfo* info) const override { 31 GradientType asAGradient(GradientInfo* info) const override {
27 return fProxyShader->asAGradient(info); 32 return fProxyShader->asAGradient(info);
28 } 33 }
29 34
30 #if SK_SUPPORT_GPU 35 #if SK_SUPPORT_GPU
31 const GrFragmentProcessor* asFragmentProcessor(GrContext* context, const SkM atrix& viewM, 36 const GrFragmentProcessor* asFragmentProcessor(GrContext* context, const SkM atrix& viewM,
32 const SkMatrix* localMatrix, SkFilterQua lity fq, 37 const SkMatrix* localMatrix, SkFilterQua lity fq,
33 GrProcessorDataManager* procDataManager) const override { 38 GrProcessorDataManager* procDataManager) const override {
34 SkMatrix tmp = this->getLocalMatrix(); 39 SkMatrix tmp = this->getLocalMatrix();
35 if (localMatrix) { 40 if (localMatrix) {
(...skipping 10 matching lines...) Expand all
46 return SkRef(fProxyShader.get()); 51 return SkRef(fProxyShader.get());
47 } 52 }
48 53
49 SK_TO_STRING_OVERRIDE() 54 SK_TO_STRING_OVERRIDE()
50 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLocalMatrixShader) 55 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLocalMatrixShader)
51 56
52 protected: 57 protected:
53 void flatten(SkWriteBuffer&) const override; 58 void flatten(SkWriteBuffer&) const override;
54 Context* onCreateContext(const ContextRec&, void*) const override; 59 Context* onCreateContext(const ContextRec&, void*) const override;
55 60
56 bool onIsABitmap(SkBitmap* bitmap, SkMatrix* matrix, TileMode* mode) const o verride {
57 return fProxyShader->isABitmap(bitmap, matrix, mode);
58 }
59
60 private: 61 private:
61 SkAutoTUnref<SkShader> fProxyShader; 62 SkAutoTUnref<SkShader> fProxyShader;
62 63
63 typedef SkShader INHERITED; 64 typedef SkShader INHERITED;
64 }; 65 };
65 66
66 #endif 67 #endif
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698