Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: src/core/SkCanvas.cpp

Issue 654873003: Implicit SkTextBlob bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: we don't need glyph widths Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkCanvasPriv.h" 9 #include "SkCanvasPriv.h"
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 2177 matching lines...) Expand 10 before | Expand all | Expand 10 after
2188 iter.fDevice->drawTextOnPath(iter, text, byteLength, path, 2188 iter.fDevice->drawTextOnPath(iter, text, byteLength, path,
2189 matrix, looper.paint()); 2189 matrix, looper.paint());
2190 } 2190 }
2191 2191
2192 LOOPER_END 2192 LOOPER_END
2193 } 2193 }
2194 2194
2195 void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, 2195 void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
2196 const SkPaint& paint) { 2196 const SkPaint& paint) {
2197 2197
2198 // FIXME: temporarily disable quickreject for empty bounds, 2198 if (paint.canComputeFastBounds()) {
2199 // pending implicit blob bounds implementation.
2200 if (!blob->bounds().isEmpty() && paint.canComputeFastBounds()) {
2201 SkRect storage; 2199 SkRect storage;
2202 2200
2203 if (this->quickReject(paint.computeFastBounds(blob->bounds().makeOffset( x, y), &storage))) { 2201 if (this->quickReject(paint.computeFastBounds(blob->bounds().makeOffset( x, y), &storage))) {
2204 return; 2202 return;
2205 } 2203 }
2206 } 2204 }
2207 2205
2208 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL) 2206 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
2209 2207
2210 while (iter.next()) { 2208 while (iter.next()) {
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2552 } 2550 }
2553 2551
2554 if (matrix) { 2552 if (matrix) {
2555 canvas->concat(*matrix); 2553 canvas->concat(*matrix);
2556 } 2554 }
2557 } 2555 }
2558 2556
2559 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2557 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2560 fCanvas->restoreToCount(fSaveCount); 2558 fCanvas->restoreToCount(fSaveCount);
2561 } 2559 }
OLDNEW
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698