| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |