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

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

Issue 376953003: Clean up SkImageFilter constructors. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed 100-col issues Created 6 years, 5 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/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.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"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 mult_color_matrix(colorMatrix, inputMatrix, combinedMatrix); 71 mult_color_matrix(colorMatrix, inputMatrix, combinedMatrix);
72 SkAutoTUnref<SkColorFilter> newCF(SkColorMatrixFilter::Create(combin edMatrix)); 72 SkAutoTUnref<SkColorFilter> newCF(SkColorMatrixFilter::Create(combin edMatrix));
73 return SkNEW_ARGS(SkColorFilterImageFilter, (newCF, input->getInput( 0), cropRect)); 73 return SkNEW_ARGS(SkColorFilterImageFilter, (newCF, input->getInput( 0), cropRect));
74 } 74 }
75 } 75 }
76 return SkNEW_ARGS(SkColorFilterImageFilter, (cf, input, cropRect)); 76 return SkNEW_ARGS(SkColorFilterImageFilter, (cf, input, cropRect));
77 } 77 }
78 78
79 SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf, 79 SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf,
80 SkImageFilter* input, const CropRect* cropRect) 80 SkImageFilter* input, const CropRect* cropRect)
81 : INHERITED(input, cropRect), fColorFilter(cf) { 81 : INHERITED(1, &input, cropRect), fColorFilter(cf) {
82 SkASSERT(cf); 82 SkASSERT(cf);
83 SkSafeRef(cf); 83 SkSafeRef(cf);
84 } 84 }
85 85
86 SkColorFilterImageFilter::SkColorFilterImageFilter(SkReadBuffer& buffer) 86 SkColorFilterImageFilter::SkColorFilterImageFilter(SkReadBuffer& buffer)
87 : INHERITED(1, buffer) { 87 : INHERITED(1, buffer) {
88 fColorFilter = buffer.readColorFilter(); 88 fColorFilter = buffer.readColorFilter();
89 } 89 }
90 90
91 void SkColorFilterImageFilter::flatten(SkWriteBuffer& buffer) const { 91 void SkColorFilterImageFilter::flatten(SkWriteBuffer& buffer) const {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 bool SkColorFilterImageFilter::asColorFilter(SkColorFilter** filter) const { 133 bool SkColorFilterImageFilter::asColorFilter(SkColorFilter** filter) const {
134 if (!cropRectIsSet()) { 134 if (!cropRectIsSet()) {
135 if (filter) { 135 if (filter) {
136 *filter = fColorFilter; 136 *filter = fColorFilter;
137 fColorFilter->ref(); 137 fColorFilter->ref();
138 } 138 }
139 return true; 139 return true;
140 } 140 }
141 return false; 141 return false;
142 } 142 }
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698