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

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

Issue 1347943003: Replace GrExtractAlphaFragmentProcessor with DstIn compose processor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update comment Created 5 years, 3 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 | « src/gpu/GrProcessor.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp
diff --git a/src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp b/src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp
deleted file mode 100644
index 483df645022afb3ebfecb6645f3b48bf44a980ba..0000000000000000000000000000000000000000
--- a/src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "effects/GrExtractAlphaFragmentProcessor.h"
-#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
-
-class GLExtractAlphaFragmentProcessor : public GrGLFragmentProcessor {
-public:
- GLExtractAlphaFragmentProcessor() {}
-
- void emitCode(EmitArgs& args) override {
- if (args.fInputColor) {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
- fsBuilder->codeAppendf("vec4 alpha4 = %s.aaaa;", args.fInputColor);
- this->emitChild(0, "alpha4", args.fOutputColor, args);
- } else {
- this->emitChild(0, nullptr, args.fOutputColor, args);
- }
- }
-
-private:
- typedef GrGLFragmentProcessor INHERITED;
-};
-
-GrGLFragmentProcessor* GrExtractAlphaFragmentProcessor::onCreateGLInstance() const {
- return SkNEW(GLExtractAlphaFragmentProcessor);
-}
-
-void GrExtractAlphaFragmentProcessor::onGetGLProcessorKey(const GrGLSLCaps&,
- GrProcessorKeyBuilder*) const {
-}
-
-bool GrExtractAlphaFragmentProcessor::onIsEqual(const GrFragmentProcessor&) const { return true; }
-
-void GrExtractAlphaFragmentProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) const {
- if (inout->validFlags() & kA_GrColorComponentFlag) {
- GrColor color = GrColorPackA4(GrColorUnpackA(inout->color()));
- inout->setToOther(kRGBA_GrColorComponentFlags, color,
- GrInvariantOutput::kWill_ReadInput);
- } else {
- inout->setToUnknown(GrInvariantOutput::kWill_ReadInput);
- }
- this->childProcessor(0).computeInvariantOutput(inout);
-}
-
-GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrExtractAlphaFragmentProcessor);
-
-const GrFragmentProcessor* GrExtractAlphaFragmentProcessor::TestCreate(GrProcessorTestData* d) {
- SkAutoTUnref<const GrFragmentProcessor> child(GrProcessorUnitTest::CreateChildFP(d));
- return SkNEW_ARGS(GrExtractAlphaFragmentProcessor, (child));
-}
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698