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

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

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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/SkColorShader.cpp ('k') | 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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 SkComposeShader_DEFINED 8 #ifndef SkComposeShader_DEFINED
9 #define SkComposeShader_DEFINED 9 #define SkComposeShader_DEFINED
10 10
(...skipping 17 matching lines...) Expand all
28 @param mode The xfermode that combines the colors from the two shade rs. If mode 28 @param mode The xfermode that combines the colors from the two shade rs. If mode
29 is null, then SRC_OVER is assumed. 29 is null, then SRC_OVER is assumed.
30 */ 30 */
31 SkComposeShader(sk_sp<SkShader> sA, sk_sp<SkShader> sB, sk_sp<SkXfermode> mo de) 31 SkComposeShader(sk_sp<SkShader> sA, sk_sp<SkShader> sB, sk_sp<SkXfermode> mo de)
32 : fShaderA(std::move(sA)) 32 : fShaderA(std::move(sA))
33 , fShaderB(std::move(sB)) 33 , fShaderB(std::move(sB))
34 , fMode(std::move(mode)) 34 , fMode(std::move(mode))
35 {} 35 {}
36 36
37 #if SK_SUPPORT_GPU 37 #if SK_SUPPORT_GPU
38 const GrFragmentProcessor* asFragmentProcessor(GrContext*, 38 sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*,
39 const SkMatrix& viewM, 39 const SkMatrix& viewM,
40 const SkMatrix* localMatrix, 40 const SkMatrix* localMatrix,
41 SkFilterQuality, 41 SkFilterQuality,
42 SkSourceGammaTreatment) cons t override; 42 SkSourceGammaTreatment) const override;
43 #endif 43 #endif
44 44
45 class ComposeShaderContext : public SkShader::Context { 45 class ComposeShaderContext : public SkShader::Context {
46 public: 46 public:
47 // When this object gets destroyed, it will call contextA and contextB's destructor 47 // When this object gets destroyed, it will call contextA and contextB's destructor
48 // but it will NOT free the memory. 48 // but it will NOT free the memory.
49 ComposeShaderContext(const SkComposeShader&, const ContextRec&, 49 ComposeShaderContext(const SkComposeShader&, const ContextRec&,
50 SkShader::Context* contextA, SkShader::Context* con textB); 50 SkShader::Context* contextA, SkShader::Context* con textB);
51 51
52 SkShader::Context* getShaderContextA() const { return fShaderContextA; } 52 SkShader::Context* getShaderContextA() const { return fShaderContextA; }
(...skipping 28 matching lines...) Expand all
81 81
82 private: 82 private:
83 sk_sp<SkShader> fShaderA; 83 sk_sp<SkShader> fShaderA;
84 sk_sp<SkShader> fShaderB; 84 sk_sp<SkShader> fShaderB;
85 sk_sp<SkXfermode> fMode; 85 sk_sp<SkXfermode> fMode;
86 86
87 typedef SkShader INHERITED; 87 typedef SkShader INHERITED;
88 }; 88 };
89 89
90 #endif 90 #endif
OLDNEW
« no previous file with comments | « src/core/SkColorShader.cpp ('k') | src/core/SkComposeShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698