OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "SkDevice.h" | 8 #include "SkDevice.h" |
9 #include "SkDeviceProperties.h" | 9 #include "SkDeviceProperties.h" |
10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 draw.drawPath(path, paint, prePathMatrix, pathIsMutable); | 370 draw.drawPath(path, paint, prePathMatrix, pathIsMutable); |
371 } | 371 } |
372 | 372 |
373 void SkDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, | 373 void SkDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, |
374 const SkMatrix& matrix, const SkPaint& paint) { | 374 const SkMatrix& matrix, const SkPaint& paint) { |
375 draw.drawBitmap(bitmap, matrix, paint); | 375 draw.drawBitmap(bitmap, matrix, paint); |
376 } | 376 } |
377 | 377 |
378 void SkDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, | 378 void SkDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, |
379 const SkRect* src, const SkRect& dst, | 379 const SkRect* src, const SkRect& dst, |
380 const SkPaint& paint) { | 380 const SkPaint& paint, |
| 381 SkCanvas::DrawBitmapRectFlags flags) { |
381 SkMatrix matrix; | 382 SkMatrix matrix; |
382 SkRect bitmapBounds, tmpSrc, tmpDst; | 383 SkRect bitmapBounds, tmpSrc, tmpDst; |
383 SkBitmap tmpBitmap; | 384 SkBitmap tmpBitmap; |
384 | 385 |
385 bitmapBounds.isetWH(bitmap.width(), bitmap.height()); | 386 bitmapBounds.isetWH(bitmap.width(), bitmap.height()); |
386 | 387 |
387 // Compute matrix from the two rectangles | 388 // Compute matrix from the two rectangles |
388 if (src) { | 389 if (src) { |
389 tmpSrc = *src; | 390 tmpSrc = *src; |
390 } else { | 391 } else { |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 paint.getStyle() != SkPaint::kFill_Style || | 524 paint.getStyle() != SkPaint::kFill_Style || |
524 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { | 525 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { |
525 // turn off lcd | 526 // turn off lcd |
526 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; | 527 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; |
527 flags->fHinting = paint.getHinting(); | 528 flags->fHinting = paint.getHinting(); |
528 return true; | 529 return true; |
529 } | 530 } |
530 // we're cool with the paint as is | 531 // we're cool with the paint as is |
531 return false; | 532 return false; |
532 } | 533 } |
OLD | NEW |