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

Unified Diff: src/core/SkOrderedReadBuffer.cpp

Issue 15489004: New API for encoding bitmaps during serialization. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix ifdef'd out code Created 7 years, 7 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
Index: src/core/SkOrderedReadBuffer.cpp
diff --git a/src/core/SkOrderedReadBuffer.cpp b/src/core/SkOrderedReadBuffer.cpp
index 4af64706a1db70e9246863a75f1ef9d183982c11..12343114f99e7d164dc3a93fc9d9acfdd1b58def 100644
--- a/src/core/SkOrderedReadBuffer.cpp
+++ b/src/core/SkOrderedReadBuffer.cpp
@@ -209,7 +209,13 @@ void SkOrderedReadBuffer::readBitmap(SkBitmap* bitmap) {
// FIXME: Once the writer is changed to record the (x,y) offset,
// they will be used to store the correct portion of the picture.
SkBitmap subsetBm;
+#ifdef BUMP_PICTURE_VERSION
+ int32_t x = fReader.readS32();
+ int32_t y = fReader.readS32();
+ SkIRect subset = SkIRect::MakeXYWH(x, y, width, height);
+#else
SkIRect subset = SkIRect::MakeWH(width, height);
+#endif
if (bitmap->extractSubset(&subsetBm, subset)) {
bitmap->swap(subsetBm);
return;

Powered by Google App Engine
This is Rietveld 408576698