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

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

Issue 1569873003: Revert of SkTreatAsSprite should take AA into account (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | 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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 2202 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 2213
2214 LOOPER_END 2214 LOOPER_END
2215 } 2215 }
2216 2216
2217 bool SkCanvas::canDrawBitmapAsSprite(SkScalar x, SkScalar y, int w, int h, const SkPaint& paint) { 2217 bool SkCanvas::canDrawBitmapAsSprite(SkScalar x, SkScalar y, int w, int h, const SkPaint& paint) {
2218 if (!paint.getImageFilter()) { 2218 if (!paint.getImageFilter()) {
2219 return false; 2219 return false;
2220 } 2220 }
2221 2221
2222 const SkMatrix& ctm = this->getTotalMatrix(); 2222 const SkMatrix& ctm = this->getTotalMatrix();
2223 if (!SkTreatAsSprite(ctm, SkISize::Make(w, h), paint)) { 2223 const unsigned kSubpixelBits = 0; // matching SkDraw::drawBitmap()
2224 if (!SkTreatAsSprite(ctm, w, h, kSubpixelBits)) {
2224 return false; 2225 return false;
2225 } 2226 }
2226 2227
2227 // Currently we can only use the filterSprite code if we are clipped to the bitmap's bounds. 2228 // Currently we can only use the filterSprite code if we are clipped to the bitmap's bounds.
2228 // Once we can filter and the filter will return a result larger than itself , we should be 2229 // Once we can filter and the filter will return a result larger than itself , we should be
2229 // able to remove this constraint. 2230 // able to remove this constraint.
2230 // skbug.com/4526 2231 // skbug.com/4526
2231 // 2232 //
2232 SkPoint pt; 2233 SkPoint pt;
2233 ctm.mapXY(x, y, &pt); 2234 ctm.mapXY(x, y, &pt);
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
3021 } 3022 }
3022 3023
3023 if (matrix) { 3024 if (matrix) {
3024 canvas->concat(*matrix); 3025 canvas->concat(*matrix);
3025 } 3026 }
3026 } 3027 }
3027 3028
3028 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3029 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3029 fCanvas->restoreToCount(fSaveCount); 3030 fCanvas->restoreToCount(fSaveCount);
3030 } 3031 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698