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

Unified Diff: src/core/SkCanvas.cpp

Issue 536003002: Hide fields in SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix qt Created 6 years, 3 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/SkBitmapProcState.cpp ('k') | src/core/SkMallocPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkMallocPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698