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

Unified Diff: src/core/SkXfermode.cpp

Issue 13097006: Add interface to SkXfermode to return a GrEffect and blend coeffs. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Add SkGpuDevice.cpp Created 7 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/SkXfermode.cpp
===================================================================
--- src/core/SkXfermode.cpp (revision 8410)
+++ src/core/SkXfermode.cpp (working copy)
@@ -680,6 +680,22 @@
return false;
}
+bool SkXfermode::asNewEffect(GrContext*, GrEffectRef**, Coeff*, Coeff*) const {
+ return false;
+}
+
+bool SkXfermode::AsNewEffect(SkXfermode* xfermode,
+ GrContext* context,
+ GrEffectRef** effect,
+ Coeff* src,
+ Coeff* dst) {
+ if (NULL == xfermode) {
robertphillips 2013/03/27 18:12:09 do we need to set 'effect' to be NULL as part of t
bsalomon 2013/03/27 18:39:42 Yes, will add that.
+ return ModeAsCoeff(kSrcOver_Mode, src, dst);
+ } else {
+ return xfermode->asNewEffect(context, effect, src, dst);
+ }
+}
+
SkPMColor SkXfermode::xferColor(SkPMColor src, SkPMColor dst) const{
// no-op. subclasses should override this
return dst;
@@ -958,6 +974,10 @@
return true;
}
+ virtual bool asNewEffect(GrContext*, GrEffectRef**, Coeff* src, Coeff* dst) const SK_OVERRIDE {
+ return this->asCoeff(src, dst);
+ }
+
SK_DEVELOPER_TO_STRING()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcCoeffXfermode)

Powered by Google App Engine
This is Rietveld 408576698