aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLBlend.h
diff options
context:
space:
mode:
authorGravatar wangyix <wangyix@google.com>2015-07-24 13:48:26 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-24 13:48:26 -0700
commitcef14bf9ce626e6e6582f3aac18c8e176b987f3e (patch)
treed837df18431e8ff9f8dafe595f378ff219dd0c96 /src/gpu/gl/GrGLBlend.h
parent20dac8856594aa633c8c7562304c865864f666ff (diff)
Added GrGLBlend.h|cpp with helper function AppendPorterDuffBlend() in preparation for SkComposeShader gpu backend
Diffstat (limited to 'src/gpu/gl/GrGLBlend.h')
-rw-r--r--src/gpu/gl/GrGLBlend.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLBlend.h b/src/gpu/gl/GrGLBlend.h
new file mode 100644
index 0000000000..af447b47bf
--- /dev/null
+++ b/src/gpu/gl/GrGLBlend.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrGLBlend_DEFINED
+#define GrGLBlend_DEFINED
+
+#include "SkXfermode.h"
+
+class GrGLFragmentBuilder;
+
+namespace GrGLBlend {
+ /*
+ * Appends GLSL code to fsBuilder that assigns a specified blend of the srcColor and dstColor
+ * variables to the outColor variable.
+ */
+ void AppendPorterDuffBlend(GrGLFragmentBuilder* fsBuilder, const char* srcColor,
+ const char* dstColor, const char* outColor, SkXfermode::Mode mode);
+};
+
+#endif