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

Side by Side Diff: src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp

Issue 1360653004: Remove SkNEW and SkDELETE macros (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Restore comment about new/delete Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/gpu/batches/GrDrawPathBatch.h ('k') | src/image/SkImage_Generator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "effects/GrExtractAlphaFragmentProcessor.h" 8 #include "effects/GrExtractAlphaFragmentProcessor.h"
9 #include "gl/GrGLFragmentProcessor.h" 9 #include "gl/GrGLFragmentProcessor.h"
10 #include "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 10 matching lines...) Expand all
21 } else { 21 } else {
22 this->emitChild(0, nullptr, args.fOutputColor, args); 22 this->emitChild(0, nullptr, args.fOutputColor, args);
23 } 23 }
24 } 24 }
25 25
26 private: 26 private:
27 typedef GrGLFragmentProcessor INHERITED; 27 typedef GrGLFragmentProcessor INHERITED;
28 }; 28 };
29 29
30 GrGLFragmentProcessor* GrExtractAlphaFragmentProcessor::onCreateGLInstance() con st { 30 GrGLFragmentProcessor* GrExtractAlphaFragmentProcessor::onCreateGLInstance() con st {
31 return SkNEW(GLExtractAlphaFragmentProcessor); 31 return new GLExtractAlphaFragmentProcessor;
32 } 32 }
33 33
34 void GrExtractAlphaFragmentProcessor::onGetGLProcessorKey(const GrGLSLCaps&, 34 void GrExtractAlphaFragmentProcessor::onGetGLProcessorKey(const GrGLSLCaps&,
35 GrProcessorKeyBuilder* ) const { 35 GrProcessorKeyBuilder* ) const {
36 } 36 }
37 37
38 bool GrExtractAlphaFragmentProcessor::onIsEqual(const GrFragmentProcessor&) cons t { return true; } 38 bool GrExtractAlphaFragmentProcessor::onIsEqual(const GrFragmentProcessor&) cons t { return true; }
39 39
40 void GrExtractAlphaFragmentProcessor::onComputeInvariantOutput(GrInvariantOutput * inout) const { 40 void GrExtractAlphaFragmentProcessor::onComputeInvariantOutput(GrInvariantOutput * inout) const {
41 if (inout->validFlags() & kA_GrColorComponentFlag) { 41 if (inout->validFlags() & kA_GrColorComponentFlag) {
42 GrColor color = GrColorPackA4(GrColorUnpackA(inout->color())); 42 GrColor color = GrColorPackA4(GrColorUnpackA(inout->color()));
43 inout->setToOther(kRGBA_GrColorComponentFlags, color, 43 inout->setToOther(kRGBA_GrColorComponentFlags, color,
44 GrInvariantOutput::kWill_ReadInput); 44 GrInvariantOutput::kWill_ReadInput);
45 } else { 45 } else {
46 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); 46 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput);
47 } 47 }
48 this->childProcessor(0).computeInvariantOutput(inout); 48 this->childProcessor(0).computeInvariantOutput(inout);
49 } 49 }
50 50
51 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrExtractAlphaFragmentProcessor); 51 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrExtractAlphaFragmentProcessor);
52 52
53 const GrFragmentProcessor* GrExtractAlphaFragmentProcessor::TestCreate(GrProcess orTestData* d) { 53 const GrFragmentProcessor* GrExtractAlphaFragmentProcessor::TestCreate(GrProcess orTestData* d) {
54 SkAutoTUnref<const GrFragmentProcessor> child(GrProcessorUnitTest::CreateChi ldFP(d)); 54 SkAutoTUnref<const GrFragmentProcessor> child(GrProcessorUnitTest::CreateChi ldFP(d));
55 return SkNEW_ARGS(GrExtractAlphaFragmentProcessor, (child)); 55 return new GrExtractAlphaFragmentProcessor(child);
56 } 56 }
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDrawPathBatch.h ('k') | src/image/SkImage_Generator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698