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

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: asFragmentProcessor returns false if xfermode is kClear_Mode Created 5 years, 4 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') | src/core/SkComposeShader.cpp » ('J')
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 bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix& viewM, const SkMatrix*,
40 GrColor*, GrProcessorDataManager*,
41 GrFragmentProcessor**) const override;
42
39 class ComposeShaderContext : public SkShader::Context { 43 class ComposeShaderContext : public SkShader::Context {
40 public: 44 public:
41 // When this object gets destroyed, it will call contextA and contextB's destructor 45 // When this object gets destroyed, it will call contextA and contextB's destructor
42 // but it will NOT free the memory. 46 // but it will NOT free the memory.
43 ComposeShaderContext(const SkComposeShader&, const ContextRec&, 47 ComposeShaderContext(const SkComposeShader&, const ContextRec&,
44 SkShader::Context* contextA, SkShader::Context* con textB); 48 SkShader::Context* contextA, SkShader::Context* con textB);
45 49
46 SkShader::Context* getShaderContextA() const { return fShaderContextA; } 50 SkShader::Context* getShaderContextA() const { return fShaderContextA; }
47 SkShader::Context* getShaderContextB() const { return fShaderContextB; } 51 SkShader::Context* getShaderContextB() const { return fShaderContextB; }
48 52
(...skipping 25 matching lines...) Expand all
74 78
75 private: 79 private:
76 SkShader* fShaderA; 80 SkShader* fShaderA;
77 SkShader* fShaderB; 81 SkShader* fShaderB;
78 SkXfermode* fMode; 82 SkXfermode* fMode;
79 83
80 typedef SkShader INHERITED; 84 typedef SkShader INHERITED;
81 }; 85 };
82 86
83 #endif 87 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkComposeShader.cpp » ('j') | src/core/SkComposeShader.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698