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

Unified Diff: src/device/xps/SkXPSDevice.cpp

Issue 19977003: drawBitmap* cleanup (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fixed bugs Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/device/xps/SkXPSDevice.cpp
===================================================================
--- src/device/xps/SkXPSDevice.cpp (revision 10315)
+++ src/device/xps/SkXPSDevice.cpp (working copy)
@@ -1949,25 +1949,13 @@
}
void SkXPSDevice::drawBitmap(const SkDraw& d, const SkBitmap& bitmap,
- const SkIRect* srcRectOrNull,
const SkMatrix& matrix, const SkPaint& paint) {
if (d.fClip->isEmpty()) {
return;
}
SkIRect srcRect;
- SkBitmap tmp;
- const SkBitmap* bitmapPtr = &bitmap;
- if (NULL == srcRectOrNull) {
- srcRect.set(0, 0, bitmap.width(), bitmap.height());
- bitmapPtr = &bitmap;
- } else {
- srcRect = *srcRectOrNull;
- if (!bitmap.extractSubset(&tmp, srcRect)) {
- return; // extraction failed
- }
- bitmapPtr = &tmp;
- }
+ srcRect.set(0, 0, bitmap.width(), bitmap.height());
//Create the new shaded path.
SkTScopedComPtr<IXpsOMPath> shadedPath;
@@ -2007,7 +1995,7 @@
SkShader::kClamp_TileMode,
};
SkTScopedComPtr<IXpsOMTileBrush> xpsImageBrush;
- HRV(this->createXpsImageBrush(*bitmapPtr,
+ HRV(this->createXpsImageBrush(bitmap,
transform,
xy,
paint.getAlpha(),
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698