OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
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 "SkTileImageFilter.h" | 8 #include "SkTileImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return false; | 75 return false; |
76 } | 76 } |
77 } else { | 77 } else { |
78 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(srcIRect.width(), | 78 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(srcIRect.width(), |
79 srcIRect.height(), | 79 srcIRect.height(), |
80 kPossible_TileUsag
e)); | 80 kPossible_TileUsag
e)); |
81 if (!device) { | 81 if (!device) { |
82 return false; | 82 return false; |
83 } | 83 } |
84 SkCanvas canvas(device); | 84 SkCanvas canvas(device); |
85 canvas.drawBitmap(src, SkIntToScalar(srcOffset.x()), | 85 canvas.drawBitmap(source, SkIntToScalar(srcOffset.x()), |
86 SkIntToScalar(srcOffset.y())); | 86 SkIntToScalar(srcOffset.y())); |
87 subset = device->accessBitmap(false); | 87 subset = device->accessBitmap(false); |
88 } | 88 } |
89 SkASSERT(subset.width() == srcIRect.width()); | 89 SkASSERT(subset.width() == srcIRect.width()); |
90 SkASSERT(subset.height() == srcIRect.height()); | 90 SkASSERT(subset.height() == srcIRect.height()); |
91 | 91 |
92 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(w, h)); | 92 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(w, h)); |
93 if (nullptr == device.get()) { | 93 if (nullptr == device.get()) { |
94 return false; | 94 return false; |
95 } | 95 } |
96 SkCanvas canvas(device); | 96 SkCanvas canvas(device); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 str->appendf(" dst: %.2f %.2f %.2f %.2f", | 144 str->appendf(" dst: %.2f %.2f %.2f %.2f", |
145 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto
m); | 145 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto
m); |
146 if (this->getInput(0)) { | 146 if (this->getInput(0)) { |
147 str->appendf("input: ("); | 147 str->appendf("input: ("); |
148 this->getInput(0)->toString(str); | 148 this->getInput(0)->toString(str); |
149 str->appendf(")"); | 149 str->appendf(")"); |
150 } | 150 } |
151 str->append(")"); | 151 str->append(")"); |
152 } | 152 } |
153 #endif | 153 #endif |
OLD | NEW |