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 "SkMergeImageFilter.h" | 8 #include "SkMergeImageFilter.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkDevice.h" | 10 #include "SkDevice.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 const SkIRect srcBounds = SkIRect::MakeXYWH(loc->x(), loc->y(), | 102 const SkIRect srcBounds = SkIRect::MakeXYWH(loc->x(), loc->y(), |
103 src.width(), src.height()); | 103 src.width(), src.height()); |
104 SkIRect bounds; | 104 SkIRect bounds; |
105 if (!this->filterBounds(srcBounds, ctm, &bounds)) { | 105 if (!this->filterBounds(srcBounds, ctm, &bounds)) { |
106 return false; | 106 return false; |
107 } | 107 } |
108 | 108 |
109 const int x0 = bounds.left(); | 109 const int x0 = bounds.left(); |
110 const int y0 = bounds.top(); | 110 const int y0 = bounds.top(); |
111 | 111 |
112 SkAutoTUnref<SkDevice> dst(proxy->createDevice(bounds.width(), bounds.height
())); | 112 SkAutoTUnref<SkBaseDevice> dst(proxy->createDevice(bounds.width(), bounds.he
ight())); |
113 if (NULL == dst) { | 113 if (NULL == dst) { |
114 return false; | 114 return false; |
115 } | 115 } |
116 SkCanvas canvas(dst); | 116 SkCanvas canvas(dst); |
117 SkPaint paint; | 117 SkPaint paint; |
118 | 118 |
119 int inputCount = countInputs(); | 119 int inputCount = countInputs(); |
120 for (int i = 0; i < inputCount; ++i) { | 120 for (int i = 0; i < inputCount; ++i) { |
121 SkBitmap tmp; | 121 SkBitmap tmp; |
122 const SkBitmap* srcPtr; | 122 const SkBitmap* srcPtr; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 SkMergeImageFilter::SkMergeImageFilter(SkFlattenableReadBuffer& buffer) : INHERI
TED(buffer) { | 156 SkMergeImageFilter::SkMergeImageFilter(SkFlattenableReadBuffer& buffer) : INHERI
TED(buffer) { |
157 bool hasModes = buffer.readBool(); | 157 bool hasModes = buffer.readBool(); |
158 if (hasModes) { | 158 if (hasModes) { |
159 this->initAllocModes(); | 159 this->initAllocModes(); |
160 SkASSERT(buffer.getArrayCount() == countInputs() * sizeof(fModes[0])); | 160 SkASSERT(buffer.getArrayCount() == countInputs() * sizeof(fModes[0])); |
161 buffer.readByteArray(fModes); | 161 buffer.readByteArray(fModes); |
162 } else { | 162 } else { |
163 fModes = 0; | 163 fModes = 0; |
164 } | 164 } |
165 } | 165 } |
OLD | NEW |