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 "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
11 #include "SkBitmapDevice.h" | 11 #include "SkBitmapDevice.h" |
12 #include "SkDeviceImageFilterProxy.h" | 12 #include "SkDeviceImageFilterProxy.h" |
13 #include "SkDraw.h" | 13 #include "SkDraw.h" |
14 #include "SkDrawFilter.h" | 14 #include "SkDrawFilter.h" |
15 #include "SkDrawLooper.h" | 15 #include "SkDrawLooper.h" |
16 #include "SkMetaData.h" | 16 #include "SkMetaData.h" |
17 #include "SkPathOps.h" | 17 #include "SkPathOps.h" |
18 #include "SkPatchUtils.h" | 18 #include "SkPatchUtils.h" |
19 #include "SkPicture.h" | 19 #include "SkPicture.h" |
20 #include "SkRasterClip.h" | 20 #include "SkRasterClip.h" |
21 #include "SkRRect.h" | 21 #include "SkRRect.h" |
22 #include "SkSmallAllocator.h" | 22 #include "SkSmallAllocator.h" |
23 #include "SkSurface_Base.h" | 23 #include "SkSurface_Base.h" |
24 #include "SkTemplates.h" | 24 #include "SkTemplates.h" |
| 25 #include "SkTextBlob.h" |
25 #include "SkTextFormatParams.h" | 26 #include "SkTextFormatParams.h" |
26 #include "SkTLazy.h" | 27 #include "SkTLazy.h" |
27 #include "SkUtils.h" | 28 #include "SkUtils.h" |
28 | 29 |
29 #if SK_SUPPORT_GPU | 30 #if SK_SUPPORT_GPU |
30 #include "GrRenderTarget.h" | 31 #include "GrRenderTarget.h" |
31 #endif | 32 #endif |
32 | 33 |
33 // experimental for faster tiled drawing... | 34 // experimental for faster tiled drawing... |
34 //#define SK_ENABLE_CLIP_QUICKREJECT | 35 //#define SK_ENABLE_CLIP_QUICKREJECT |
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2210 while (iter.next()) { | 2211 while (iter.next()) { |
2211 iter.fDevice->drawTextOnPath(iter, text, byteLength, path, | 2212 iter.fDevice->drawTextOnPath(iter, text, byteLength, path, |
2212 matrix, looper.paint()); | 2213 matrix, looper.paint()); |
2213 } | 2214 } |
2214 | 2215 |
2215 LOOPER_END | 2216 LOOPER_END |
2216 } | 2217 } |
2217 | 2218 |
2218 void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, | 2219 void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
2219 const SkPaint& paint) { | 2220 const SkPaint& paint) { |
| 2221 |
| 2222 // FIXME: temporarily disable quickreject for empty bounds, |
| 2223 // pending implicit blob bounds implementation. |
| 2224 if (!blob->bounds().isEmpty() && paint.canComputeFastBounds()) { |
| 2225 SkRect storage; |
| 2226 |
| 2227 if (this->quickReject(paint.computeFastBounds(blob->bounds().makeOffset(
x, y), &storage))) { |
| 2228 return; |
| 2229 } |
| 2230 } |
| 2231 |
2220 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL) | 2232 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL) |
2221 | 2233 |
2222 while (iter.next()) { | 2234 while (iter.next()) { |
2223 SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint()); | 2235 SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint()); |
2224 iter.fDevice->drawTextBlob(iter, blob, x, y, dfp.paint()); | 2236 iter.fDevice->drawTextBlob(iter, blob, x, y, dfp.paint()); |
2225 } | 2237 } |
2226 | 2238 |
2227 LOOPER_END | 2239 LOOPER_END |
2228 } | 2240 } |
2229 | 2241 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2564 } | 2576 } |
2565 | 2577 |
2566 if (NULL != matrix) { | 2578 if (NULL != matrix) { |
2567 canvas->concat(*matrix); | 2579 canvas->concat(*matrix); |
2568 } | 2580 } |
2569 } | 2581 } |
2570 | 2582 |
2571 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2583 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2572 fCanvas->restoreToCount(fSaveCount); | 2584 fCanvas->restoreToCount(fSaveCount); |
2573 } | 2585 } |
OLD | NEW |