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

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

Issue 1823573003: Change signatures of filter bounds methods to return a rect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Hide legacy API behind #ifdef; switch callers to new API Created 4 years, 9 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 * 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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveLayerFlags saveLayerFlag s, 1070 bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveLayerFlags saveLayerFlag s,
1071 SkIRect* intersection, const SkImageFilter* imageF ilter) { 1071 SkIRect* intersection, const SkImageFilter* imageF ilter) {
1072 SkIRect clipBounds; 1072 SkIRect clipBounds;
1073 if (!this->getClipDeviceBounds(&clipBounds)) { 1073 if (!this->getClipDeviceBounds(&clipBounds)) {
1074 return false; 1074 return false;
1075 } 1075 }
1076 1076
1077 const SkMatrix& ctm = fMCRec->fMatrix; // this->getTotalMatrix() 1077 const SkMatrix& ctm = fMCRec->fMatrix; // this->getTotalMatrix()
1078 1078
1079 if (imageFilter) { 1079 if (imageFilter) {
1080 imageFilter->filterBounds(clipBounds, ctm, &clipBounds); 1080 clipBounds = imageFilter->filterBounds(clipBounds, ctm);
1081 if (bounds && !imageFilter->canComputeFastBounds()) { 1081 if (bounds && !imageFilter->canComputeFastBounds()) {
1082 bounds = nullptr; 1082 bounds = nullptr;
1083 } 1083 }
1084 } 1084 }
1085 SkIRect ir; 1085 SkIRect ir;
1086 if (bounds) { 1086 if (bounds) {
1087 SkRect r; 1087 SkRect r;
1088 1088
1089 ctm.mapRect(&r, *bounds); 1089 ctm.mapRect(&r, *bounds);
1090 r.roundOut(&ir); 1090 r.roundOut(&ir);
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
3036 } 3036 }
3037 3037
3038 if (matrix) { 3038 if (matrix) {
3039 canvas->concat(*matrix); 3039 canvas->concat(*matrix);
3040 } 3040 }
3041 } 3041 }
3042 3042
3043 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3043 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3044 fCanvas->restoreToCount(fSaveCount); 3044 fCanvas->restoreToCount(fSaveCount);
3045 } 3045 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698