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

Unified Diff: src/effects/SkColorCubeFilter.cpp

Issue 1368423003: Use child processors to implement compose color filter. (Closed) Base URL: https://skia.googlesource.com/skia.git@upm
Patch Set: Address comments 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/core/SkColorFilter.cpp ('k') | src/effects/SkColorFilters.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorCubeFilter.cpp
diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp
index da5635cf71ded6b35492a48fa2ecf7f401e5539c..54c0e37a840d5145df7ee72a0bf040761c2c04c6 100644
--- a/src/effects/SkColorCubeFilter.cpp
+++ b/src/effects/SkColorCubeFilter.cpp
@@ -160,7 +160,7 @@ void SkColorCubeFilter::toString(SkString* str) const {
class GrColorCubeEffect : public GrFragmentProcessor {
public:
- static GrFragmentProcessor* Create(GrTexture* colorCube) {
+ static const GrFragmentProcessor* Create(GrTexture* colorCube) {
return (nullptr != colorCube) ? new GrColorCubeEffect(colorCube) : nullptr;
}
@@ -303,8 +303,8 @@ void GrColorCubeEffect::GLProcessor::GenKey(const GrProcessor& proc,
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
}
-bool SkColorCubeFilter::asFragmentProcessors(GrContext* context, GrProcessorDataManager*,
- SkTDArray<const GrFragmentProcessor*>* array) const {
+const GrFragmentProcessor* SkColorCubeFilter::asFragmentProcessor(GrContext* context,
+ GrProcessorDataManager*) const {
static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
GrUniqueKey key;
GrUniqueKey::Builder builder(&key, kDomain, 2);
@@ -324,19 +324,11 @@ bool SkColorCubeFilter::asFragmentProcessors(GrContext* context, GrProcessorData
desc, true, fCubeData->data(), 0));
if (textureCube) {
context->textureProvider()->assignUniqueKeyToTexture(key, textureCube);
- }
- }
-
- GrFragmentProcessor* frag = textureCube ? GrColorCubeEffect::Create(textureCube) : nullptr;
- if (frag) {
- if (array) {
- *array->append() = frag;
} else {
- frag->unref();
- SkDEBUGCODE(frag = nullptr;)
+ return nullptr;
}
- return true;
}
- return false;
+
+ return GrColorCubeEffect::Create(textureCube);
}
#endif
« no previous file with comments | « src/core/SkColorFilter.cpp ('k') | src/effects/SkColorFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698