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

Unified Diff: src/gpu/GrBlend.h

Issue 22558003: Add blend optimization helpers and use to convert rect draws to clears. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: suppress warning Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrSurface.h ('k') | src/gpu/GrBlend.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBlend.h
diff --git a/src/gpu/GrBlend.h b/src/gpu/GrBlend.h
new file mode 100644
index 0000000000000000000000000000000000000000..e70d9457772c30e1f5a5660c5a25b98c58043a1a
--- /dev/null
+++ b/src/gpu/GrBlend.h
@@ -0,0 +1,45 @@
+
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrTypes.h"
+#include "GrColor.h"
+
+#ifndef GrBlend_DEFINED
+#define GrBlend_DEFINED
+
+static inline bool GrBlendCoeffRefsSrc(GrBlendCoeff coeff) {
+ switch (coeff) {
+ case kSC_GrBlendCoeff:
+ case kISC_GrBlendCoeff:
+ case kSA_GrBlendCoeff:
+ case kISA_GrBlendCoeff:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static inline bool GrBlendCoeffRefsDst(GrBlendCoeff coeff) {
+ switch (coeff) {
+ case kDC_GrBlendCoeff:
+ case kIDC_GrBlendCoeff:
+ case kDA_GrBlendCoeff:
+ case kIDA_GrBlendCoeff:
+ return true;
+ default:
+ return false;
+ }
+}
+
+GrColor GrSimplifyBlend(GrBlendCoeff* srcCoeff,
+ GrBlendCoeff* dstCoeff,
+ GrColor srcColor, uint32_t srcCompFlags,
+ GrColor dstColor, uint32_t dstCompFlags,
+ GrColor constantColor);
+
+#endif
« no previous file with comments | « include/gpu/GrSurface.h ('k') | src/gpu/GrBlend.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698