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

Unified Diff: src/core/SkComposeShader.h

Issue 1832223002: switch xfermodes over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkComposeShader.h
diff --git a/src/core/SkComposeShader.h b/src/core/SkComposeShader.h
index 8ea7c67ae7fdd87fd8dfacad154577d6ccce342a..4d561faac76b8a035a037f2e3a8d38b8c69a2e39 100644
--- a/src/core/SkComposeShader.h
+++ b/src/core/SkComposeShader.h
@@ -5,13 +5,11 @@
* found in the LICENSE file.
*/
-
#ifndef SkComposeShader_DEFINED
#define SkComposeShader_DEFINED
#include "SkShader.h"
-
-class SkXfermode;
+#include "SkXfermode.h"
///////////////////////////////////////////////////////////////////////////////////////////
@@ -30,8 +28,11 @@ public:
@param mode The xfermode that combines the colors from the two shaders. If mode
is null, then SRC_OVER is assumed.
*/
- SkComposeShader(sk_sp<SkShader> sA, sk_sp<SkShader> sB, SkXfermode* mode = NULL);
- virtual ~SkComposeShader();
+ SkComposeShader(sk_sp<SkShader> sA, sk_sp<SkShader> sB, sk_sp<SkXfermode> mode)
+ : fShaderA(std::move(sA))
+ , fShaderB(std::move(sB))
+ , fMode(std::move(mode))
+ {}
#if SK_SUPPORT_GPU
const GrFragmentProcessor* asFragmentProcessor(GrContext*,
@@ -72,15 +73,15 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeShader)
protected:
- SkComposeShader(SkReadBuffer& );
+ SkComposeShader(SkReadBuffer&);
void flatten(SkWriteBuffer&) const override;
size_t onContextSize(const ContextRec&) const override;
Context* onCreateContext(const ContextRec&, void*) const override;
private:
- sk_sp<SkShader> fShaderA;
- sk_sp<SkShader> fShaderB;
- SkXfermode* fMode;
+ sk_sp<SkShader> fShaderA;
+ sk_sp<SkShader> fShaderB;
+ sk_sp<SkXfermode> fMode;
typedef SkShader INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698