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

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

Issue 513983002: Try out scalar picture sizes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up Created 6 years, 3 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBBoxRecord.h" 9 #include "SkBBoxRecord.h"
10 #include "SkPatchUtils.h" 10 #include "SkPatchUtils.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 const SkPaint& paint) { 306 const SkPaint& paint) {
307 SkRect bbox; 307 SkRect bbox;
308 bbox.set(cubics, SkPatchUtils::kNumCtrlPts); 308 bbox.set(cubics, SkPatchUtils::kNumCtrlPts);
309 if (this->transformBounds(bbox, &paint)) { 309 if (this->transformBounds(bbox, &paint)) {
310 INHERITED::onDrawPatch(cubics, colors, texCoords, xmode, paint); 310 INHERITED::onDrawPatch(cubics, colors, texCoords, xmode, paint);
311 } 311 }
312 } 312 }
313 313
314 void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matri x, 314 void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matri x,
315 const SkPaint* paint) { 315 const SkPaint* paint) {
316 SkRect bounds = SkRect::MakeWH(SkIntToScalar(picture->width()), 316 SkRect bounds = picture->cullRect();
317 SkIntToScalar(picture->height()));
318 // todo: wonder if we should allow passing an optional matrix to transformBo unds so we don't 317 // todo: wonder if we should allow passing an optional matrix to transformBo unds so we don't
319 // end up transforming the rect twice. 318 // end up transforming the rect twice.
320 if (matrix) { 319 if (matrix) {
321 matrix->mapRect(&bounds); 320 matrix->mapRect(&bounds);
322 } 321 }
323 if (this->transformBounds(bounds, paint)) { 322 if (this->transformBounds(bounds, paint)) {
324 this->INHERITED::onDrawPicture(picture, matrix, paint); 323 this->INHERITED::onDrawPicture(picture, matrix, paint);
325 } 324 }
326 } 325 }
327 326
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 } 371 }
373 372
374 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { 373 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) {
375 this->getTotalMatrix().mapRect(&outBounds); 374 this->getTotalMatrix().mapRect(&outBounds);
376 this->handleBBox(outBounds); 375 this->handleBBox(outBounds);
377 return true; 376 return true;
378 } 377 }
379 378
380 return false; 379 return false;
381 } 380 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698