Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index f071fc99fc99d553750182954c35efe47df2fc03..83fe1407d566b6af5afc7df6c79997ce1c906494 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -631,10 +631,8 @@ bool SkCanvas::readPixels(const SkImageInfo& origInfo, void* dstP, size_t rowByt |
return false; |
} |
- SkImageInfo info = origInfo; |
// the intersect may have shrunk info's logical size |
- info.fWidth = srcR.width(); |
- info.fHeight = srcR.height(); |
+ const SkImageInfo info = origInfo.makeWH(srcR.width(), srcR.height()); |
// if x or y are negative, then we have to adjust pixels |
if (x > 0) { |
@@ -686,10 +684,8 @@ bool SkCanvas::writePixels(const SkImageInfo& origInfo, const void* pixels, size |
return false; |
} |
- SkImageInfo info = origInfo; |
// the intersect may have shrunk info's logical size |
- info.fWidth = target.width(); |
- info.fHeight = target.height(); |
+ const SkImageInfo info = origInfo.makeWH(target.width(), target.height()); |
// if x or y are negative, then we have to adjust pixels |
if (x > 0) { |