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

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

Issue 742663002: add roundOut that returns its result (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkDraw.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 "SkCanvasDrawable.h" 9 #include "SkCanvasDrawable.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 if (!rect.isFinite()) 1579 if (!rect.isFinite())
1580 return true; 1580 return true;
1581 1581
1582 if (fMCRec->fRasterClip.isEmpty()) { 1582 if (fMCRec->fRasterClip.isEmpty()) {
1583 return true; 1583 return true;
1584 } 1584 }
1585 1585
1586 if (fMCRec->fMatrix.hasPerspective()) { 1586 if (fMCRec->fMatrix.hasPerspective()) {
1587 SkRect dst; 1587 SkRect dst;
1588 fMCRec->fMatrix.mapRect(&dst, rect); 1588 fMCRec->fMatrix.mapRect(&dst, rect);
1589 SkIRect idst; 1589 return !SkIRect::Intersects(dst.roundOut(), fMCRec->fRasterClip.getBound s());
1590 dst.roundOut(&idst);
1591 return !SkIRect::Intersects(idst, fMCRec->fRasterClip.getBounds());
1592 } else { 1590 } else {
1593 const SkRect& clipR = this->getLocalClipBounds(); 1591 const SkRect& clipR = this->getLocalClipBounds();
1594 1592
1595 // for speed, do the most likely reject compares first 1593 // for speed, do the most likely reject compares first
1596 // TODO: should we use | instead, or compare all 4 at once? 1594 // TODO: should we use | instead, or compare all 4 at once?
1597 if (rect.fTop >= clipR.fBottom || rect.fBottom <= clipR.fTop) { 1595 if (rect.fTop >= clipR.fBottom || rect.fBottom <= clipR.fTop) {
1598 return true; 1596 return true;
1599 } 1597 }
1600 if (rect.fLeft >= clipR.fRight || rect.fRight <= clipR.fLeft) { 1598 if (rect.fLeft >= clipR.fRight || rect.fRight <= clipR.fLeft) {
1601 return true; 1599 return true;
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2581 } 2579 }
2582 2580
2583 if (matrix) { 2581 if (matrix) {
2584 canvas->concat(*matrix); 2582 canvas->concat(*matrix);
2585 } 2583 }
2586 } 2584 }
2587 2585
2588 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2586 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2589 fCanvas->restoreToCount(fSaveCount); 2587 fCanvas->restoreToCount(fSaveCount);
2590 } 2588 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698