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

Unified Diff: src/gpu/effects/GrDisableColorXP.cpp

Issue 787233003: Add XP to handle the cases where we disable color write. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 6 years 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 | « src/gpu/effects/GrDisableColorXP.h ('k') | src/gpu/effects/GrPorterDuffXferProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDisableColorXP.cpp
diff --git a/src/gpu/effects/GrDisableColorXP.cpp b/src/gpu/effects/GrDisableColorXP.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ba6a45b7809735164c3f922d7e16194699762b6a
--- /dev/null
+++ b/src/gpu/effects/GrDisableColorXP.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "effects/GrDisableColorXP.h"
+#include "GrProcessor.h"
+#include "gl/GrGLXferProcessor.h"
+
+class GrGLDisableColorXP : public GrGLXferProcessor {
+public:
+ GrGLDisableColorXP(const GrProcessor&) {}
+
+ ~GrGLDisableColorXP() SK_OVERRIDE {}
+
+ void emitCode(const EmitArgs& args) SK_OVERRIDE {}
+
+ void setData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERRIDE {}
+
+ static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*) {}
+
+private:
+ typedef GrGLXferProcessor INHERITED;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+
+GrDisableColorXP::GrDisableColorXP() {
+ this->initClassID<GrDisableColorXP>();
+}
+
+void GrDisableColorXP::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
+ GrGLDisableColorXP::GenKey(*this, caps, b);
+}
+
+GrGLXferProcessor* GrDisableColorXP::createGLInstance() const {
+ return SkNEW_ARGS(GrGLDisableColorXP, (*this));
+}
+
+void GrDisableColorXP::getBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const {
+ blendInfo->fWriteColor = false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+GrDisableColorXPFactory::GrDisableColorXPFactory() {
+ this->initClassID<GrDisableColorXPFactory>();
+}
+
+GrXferProcessor* GrDisableColorXPFactory::createXferProcessor(const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& covPOI) const {
+ return GrDisableColorXP::Create();
+}
+
+GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory);
+
+GrXPFactory* GrDisableColorXPFactory::TestCreate(SkRandom* random,
+ GrContext*,
+ const GrDrawTargetCaps&,
+ GrTexture*[]) {
+ return GrDisableColorXPFactory::Create();
+}
+
« no previous file with comments | « src/gpu/effects/GrDisableColorXP.h ('k') | src/gpu/effects/GrPorterDuffXferProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698