OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 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 | 8 |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2251 } | 2251 } |
2252 | 2252 |
2253 LOOPER_END | 2253 LOOPER_END |
2254 } | 2254 } |
2255 | 2255 |
2256 void SkCanvas::drawPatch(const SkPatch& patch, const SkPaint& paint) { | 2256 void SkCanvas::drawPatch(const SkPatch& patch, const SkPaint& paint) { |
2257 | 2257 |
2258 // Since a patch is always within the convex hull of the control points, we
discard it when its | 2258 // Since a patch is always within the convex hull of the control points, we
discard it when its |
2259 // bounding rectangle is completely outside the current clip. | 2259 // bounding rectangle is completely outside the current clip. |
2260 SkRect bounds; | 2260 SkRect bounds; |
2261 bounds.set(patch.getControlPoints(), 12); | 2261 bounds.set(patch.getControlPoints(), SkPatch::kNumCtrlPts); |
2262 if (this->quickReject(bounds)) { | 2262 if (this->quickReject(bounds)) { |
2263 return; | 2263 return; |
2264 } | 2264 } |
2265 | 2265 |
2266 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) | 2266 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) |
2267 | 2267 |
2268 while (iter.next()) { | 2268 while (iter.next()) { |
2269 iter.fDevice->drawPatch(iter, patch, paint); | 2269 iter.fDevice->drawPatch(iter, patch, paint); |
2270 } | 2270 } |
2271 | 2271 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2504 if (!supported_for_raster_canvas(info)) { | 2504 if (!supported_for_raster_canvas(info)) { |
2505 return NULL; | 2505 return NULL; |
2506 } | 2506 } |
2507 | 2507 |
2508 SkBitmap bitmap; | 2508 SkBitmap bitmap; |
2509 if (!bitmap.installPixels(info, pixels, rowBytes)) { | 2509 if (!bitmap.installPixels(info, pixels, rowBytes)) { |
2510 return NULL; | 2510 return NULL; |
2511 } | 2511 } |
2512 return SkNEW_ARGS(SkCanvas, (bitmap)); | 2512 return SkNEW_ARGS(SkCanvas, (bitmap)); |
2513 } | 2513 } |
OLD | NEW |