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

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

Issue 377503004: Make GrDrawState and GrPaint take GrEffect* instead of GrEffectRef*. (Closed) Base URL: https://skia.googlesource.com/skia.git@no_ref
Patch Set: Update YUV effect to reflect these changes. Created 6 years, 5 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/SkImageFilter.cpp ('k') | src/core/SkMaskFilter.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
(...skipping 17 matching lines...) Expand all
28 return fProxyShader->asABitmap(bitmap, matrix, mode); 28 return fProxyShader->asABitmap(bitmap, matrix, mode);
29 } 29 }
30 30
31 virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE { 31 virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE {
32 return fProxyShader->asAGradient(info); 32 return fProxyShader->asAGradient(info);
33 } 33 }
34 34
35 #if SK_SUPPORT_GPU 35 #if SK_SUPPORT_GPU
36 36
37 virtual bool asNewEffect(GrContext* context, const SkPaint& paint, const SkM atrix* localMatrix, 37 virtual bool asNewEffect(GrContext* context, const SkPaint& paint, const SkM atrix* localMatrix,
38 GrColor* grColor, GrEffectRef** grEffect) const SK_ OVERRIDE { 38 GrColor* grColor, GrEffect** grEffect) const SK_OVE RRIDE {
39 SkMatrix tmp = fProxyLocalMatrix; 39 SkMatrix tmp = fProxyLocalMatrix;
40 if (localMatrix) { 40 if (localMatrix) {
41 tmp.preConcat(*localMatrix); 41 tmp.preConcat(*localMatrix);
42 } 42 }
43 return fProxyShader->asNewEffect(context, paint, &tmp, grColor, grEffect ); 43 return fProxyShader->asNewEffect(context, paint, &tmp, grColor, grEffect );
44 } 44 }
45 45
46 #else 46 #else
47 47
48 virtual bool asNewEffect(GrContext* context, const SkPaint& paint, const SkM atrix* localMatrix, 48 virtual bool asNewEffect(GrContext* context, const SkPaint& paint, const SkM atrix* localMatrix,
49 GrColor* grColor, GrEffectRef** grEffect) const SK_ OVERRIDE { 49 GrColor* grColor, GrEffect** grEffect) const SK_OVE RRIDE {
50 SkDEBUGFAIL("Should not call in GPU-less build"); 50 SkDEBUGFAIL("Should not call in GPU-less build");
51 return false; 51 return false;
52 } 52 }
53 53
54 #endif 54 #endif
55 55
56 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const SK_OV ERRIDE { 56 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const SK_OV ERRIDE {
57 if (localMatrix) { 57 if (localMatrix) {
58 *localMatrix = fProxyLocalMatrix; 58 *localMatrix = fProxyLocalMatrix;
59 } 59 }
60 return SkRef(fProxyShader.get()); 60 return SkRef(fProxyShader.get());
61 } 61 }
62 62
63 SK_TO_STRING_OVERRIDE() 63 SK_TO_STRING_OVERRIDE()
64 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLocalMatrixShader) 64 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLocalMatrixShader)
65 65
66 protected: 66 protected:
67 SkLocalMatrixShader(SkReadBuffer&); 67 SkLocalMatrixShader(SkReadBuffer&);
68 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 68 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
69 virtual Context* onCreateContext(const ContextRec&, void*) const SK_OVERRIDE ; 69 virtual Context* onCreateContext(const ContextRec&, void*) const SK_OVERRIDE ;
70 70
71 private: 71 private:
72 SkAutoTUnref<SkShader> fProxyShader; 72 SkAutoTUnref<SkShader> fProxyShader;
73 SkMatrix fProxyLocalMatrix; 73 SkMatrix fProxyLocalMatrix;
74 74
75 typedef SkShader INHERITED; 75 typedef SkShader INHERITED;
76 }; 76 };
77 77
78 #endif 78 #endif
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/core/SkMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698