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

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

Issue 654273002: Push isEqual/onIsEqual down from GrProcessor to subclasses. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/effects/GrConfigConversionEffect.h ('k') | src/gpu/effects/GrConvexPolyEffect.h » ('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 2012 Google Inc. 2 * Copyright 2012 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 "GrConfigConversionEffect.h" 8 #include "GrConfigConversionEffect.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrTBackendProcessorFactory.h" 10 #include "GrTBackendProcessorFactory.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 SkASSERT(kRGBA_8888_GrPixelConfig == texture->config() || 112 SkASSERT(kRGBA_8888_GrPixelConfig == texture->config() ||
113 kBGRA_8888_GrPixelConfig == texture->config()); 113 kBGRA_8888_GrPixelConfig == texture->config());
114 // Why did we pollute our texture cache instead of using a GrSingleTextureEf fect? 114 // Why did we pollute our texture cache instead of using a GrSingleTextureEf fect?
115 SkASSERT(swapRedAndBlue || kNone_PMConversion != pmConversion); 115 SkASSERT(swapRedAndBlue || kNone_PMConversion != pmConversion);
116 } 116 }
117 117
118 const GrBackendFragmentProcessorFactory& GrConfigConversionEffect::getFactory() const { 118 const GrBackendFragmentProcessorFactory& GrConfigConversionEffect::getFactory() const {
119 return GrTBackendFragmentProcessorFactory<GrConfigConversionEffect>::getInst ance(); 119 return GrTBackendFragmentProcessorFactory<GrConfigConversionEffect>::getInst ance();
120 } 120 }
121 121
122 bool GrConfigConversionEffect::onIsEqual(const GrProcessor& s) const { 122 bool GrConfigConversionEffect::onIsEqual(const GrFragmentProcessor& s) const {
123 const GrConfigConversionEffect& other = s.cast<GrConfigConversionEffect>(); 123 const GrConfigConversionEffect& other = s.cast<GrConfigConversionEffect>();
124 return this->texture(0) == s.texture(0) && 124 return this->texture(0) == s.texture(0) &&
125 other.fSwapRedAndBlue == fSwapRedAndBlue && 125 other.fSwapRedAndBlue == fSwapRedAndBlue &&
126 other.fPMConversion == fPMConversion; 126 other.fPMConversion == fPMConversion;
127 } 127 }
128 128
129 void GrConfigConversionEffect::onComputeInvariantOutput(InvariantOutput* inout) const { 129 void GrConfigConversionEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
130 this->updateInvariantOutputForModulation(inout); 130 this->updateInvariantOutputForModulation(inout);
131 } 131 }
132 132
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 kNone_PMConversion != pmConversion) { 275 kNone_PMConversion != pmConversion) {
276 // The PM conversions assume colors are 0..255 276 // The PM conversions assume colors are 0..255
277 return NULL; 277 return NULL;
278 } 278 }
279 return SkNEW_ARGS(GrConfigConversionEffect, (texture, 279 return SkNEW_ARGS(GrConfigConversionEffect, (texture,
280 swapRedAndBlue, 280 swapRedAndBlue,
281 pmConversion, 281 pmConversion,
282 matrix)); 282 matrix));
283 } 283 }
284 } 284 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.h ('k') | src/gpu/effects/GrConvexPolyEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698