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

Side by Side Diff: src/effects/SkColorFilterImageFilter.cpp

Issue 1395403002: change more effects to only expose factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « include/effects/SkModeColorFilter.h ('k') | src/effects/SkColorFilters.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 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 "SkColorFilterImageFilter.h" 8 #include "SkColorFilterImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkColorMatrixFilter.h" 11 #include "SkColorMatrixFilter.h"
12 #include "SkDevice.h" 12 #include "SkDevice.h"
13 #include "SkColorFilter.h" 13 #include "SkColorFilter.h"
14 #include "SkReadBuffer.h" 14 #include "SkReadBuffer.h"
15 #include "SkTableColorFilter.h" 15 #include "SkTableColorFilter.h"
16 #include "SkWriteBuffer.h" 16 #include "SkWriteBuffer.h"
17 17
18 SkColorFilterImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf, 18 SkImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf, SkImageFilter * input,
19 SkImageFilter* input, const CropRect* cropRect) { 19 const CropRect* cropRect) {
20 if (nullptr == cf) { 20 if (nullptr == cf) {
21 return nullptr; 21 return nullptr;
22 } 22 }
23 23
24 SkColorFilter* inputCF; 24 SkColorFilter* inputCF;
25 if (input && input->isColorFilterNode(&inputCF)) { 25 if (input && input->isColorFilterNode(&inputCF)) {
26 // This is an optimization, as it collapses the hierarchy by just combin ing the two 26 // This is an optimization, as it collapses the hierarchy by just combin ing the two
27 // colorfilters into a single one, which the new imagefilter will wrap. 27 // colorfilters into a single one, which the new imagefilter will wrap.
28 SkAutoUnref autoUnref(inputCF); 28 SkAutoUnref autoUnref(inputCF);
29 SkAutoTUnref<SkColorFilter> newCF(SkColorFilter::CreateComposeFilter(cf, inputCF)); 29 SkAutoTUnref<SkColorFilter> newCF(SkColorFilter::CreateComposeFilter(cf, inputCF));
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 if (this->getInput(0)) { 111 if (this->getInput(0)) {
112 this->getInput(0)->toString(str); 112 this->getInput(0)->toString(str);
113 } 113 }
114 114
115 str->appendf(") color filter: "); 115 str->appendf(") color filter: ");
116 fColorFilter->toString(str); 116 fColorFilter->toString(str);
117 117
118 str->append(")"); 118 str->append(")");
119 } 119 }
120 #endif 120 #endif
OLDNEW
« no previous file with comments | « include/effects/SkModeColorFilter.h ('k') | src/effects/SkColorFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698