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

Side by Side Diff: include/core/SkComposeShader.h

Issue 1292353005: Added SkComposeShader GPU implementation (Closed) Base URL: https://skia.googlesource.com/skia@cs3_glinstances2
Patch Set: Josh's nits 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 | « no previous file | src/core/SkComposeShader.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkComposeShader_DEFINED 10 #ifndef SkComposeShader_DEFINED
(...skipping 18 matching lines...) Expand all
29 @param shaderA The colors from this shader are seen as the "dst" by the xfermode 29 @param shaderA The colors from this shader are seen as the "dst" by the xfermode
30 @param shaderB The colors from this shader are seen as the "src" by the xfermode 30 @param shaderB The colors from this shader are seen as the "src" by the xfermode
31 @param mode The xfermode that combines the colors from the two shade rs. If mode 31 @param mode The xfermode that combines the colors from the two shade rs. If mode
32 is null, then SRC_OVER is assumed. 32 is null, then SRC_OVER is assumed.
33 */ 33 */
34 SkComposeShader(SkShader* sA, SkShader* sB, SkXfermode* mode = NULL); 34 SkComposeShader(SkShader* sA, SkShader* sB, SkXfermode* mode = NULL);
35 virtual ~SkComposeShader(); 35 virtual ~SkComposeShader();
36 36
37 size_t contextSize() const override; 37 size_t contextSize() const override;
38 38
39 #if SK_SUPPORT_GPU
40 const GrFragmentProcessor* asFragmentProcessor(GrContext*,
41 const SkMatrix& viewM,
42 const SkMatrix* localMatrix,
43 SkFilterQuality,
44 GrProcessorDataManager*) con st override;
45 #endif
46
39 class ComposeShaderContext : public SkShader::Context { 47 class ComposeShaderContext : public SkShader::Context {
40 public: 48 public:
41 // When this object gets destroyed, it will call contextA and contextB's destructor 49 // When this object gets destroyed, it will call contextA and contextB's destructor
42 // but it will NOT free the memory. 50 // but it will NOT free the memory.
43 ComposeShaderContext(const SkComposeShader&, const ContextRec&, 51 ComposeShaderContext(const SkComposeShader&, const ContextRec&,
44 SkShader::Context* contextA, SkShader::Context* con textB); 52 SkShader::Context* contextA, SkShader::Context* con textB);
45 53
46 SkShader::Context* getShaderContextA() const { return fShaderContextA; } 54 SkShader::Context* getShaderContextA() const { return fShaderContextA; }
47 SkShader::Context* getShaderContextB() const { return fShaderContextB; } 55 SkShader::Context* getShaderContextB() const { return fShaderContextB; }
48 56
(...skipping 25 matching lines...) Expand all
74 82
75 private: 83 private:
76 SkShader* fShaderA; 84 SkShader* fShaderA;
77 SkShader* fShaderB; 85 SkShader* fShaderB;
78 SkXfermode* fMode; 86 SkXfermode* fMode;
79 87
80 typedef SkShader INHERITED; 88 typedef SkShader INHERITED;
81 }; 89 };
82 90
83 #endif 91 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkComposeShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698