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

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

Issue 1228083004: add src-rect-constraint to drawImageRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 5 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 | « include/utils/SkPaintFilterCanvas.h ('k') | src/core/SkCanvas.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkConfig8888.h" 9 #include "SkConfig8888.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 draw.drawPath(path, paint, prePathMatrix, pathIsMutable); 230 draw.drawPath(path, paint, prePathMatrix, pathIsMutable);
231 } 231 }
232 232
233 void SkBitmapDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, 233 void SkBitmapDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap,
234 const SkMatrix& matrix, const SkPaint& paint) { 234 const SkMatrix& matrix, const SkPaint& paint) {
235 draw.drawBitmap(bitmap, matrix, NULL, paint); 235 draw.drawBitmap(bitmap, matrix, NULL, paint);
236 } 236 }
237 237
238 void SkBitmapDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, 238 void SkBitmapDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
239 const SkRect* src, const SkRect& dst, 239 const SkRect* src, const SkRect& dst,
240 const SkPaint& paint, 240 const SkPaint& paint, SK_VIRTUAL_CONSTRAINT_ TYPE) {
241 SkCanvas::DrawBitmapRectFlags flags) {
242 SkMatrix matrix; 241 SkMatrix matrix;
243 SkRect bitmapBounds, tmpSrc, tmpDst; 242 SkRect bitmapBounds, tmpSrc, tmpDst;
244 SkBitmap tmpBitmap; 243 SkBitmap tmpBitmap;
245 244
246 bitmapBounds.isetWH(bitmap.width(), bitmap.height()); 245 bitmapBounds.isetWH(bitmap.width(), bitmap.height());
247 246
248 // Compute matrix from the two rectangles 247 // Compute matrix from the two rectangles
249 if (src) { 248 if (src) {
250 tmpSrc = *src; 249 tmpSrc = *src;
251 } else { 250 } else {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 paint.getRasterizer() || 374 paint.getRasterizer() ||
376 paint.getPathEffect() || 375 paint.getPathEffect() ||
377 paint.isFakeBoldText() || 376 paint.isFakeBoldText() ||
378 paint.getStyle() != SkPaint::kFill_Style || 377 paint.getStyle() != SkPaint::kFill_Style ||
379 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) 378 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode))
380 { 379 {
381 return true; 380 return true;
382 } 381 }
383 return false; 382 return false;
384 } 383 }
OLDNEW
« no previous file with comments | « include/utils/SkPaintFilterCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698