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

Unified Diff: src/effects/SkBitmapSource.cpp

Issue 295793002: stop calling SkBitmap::flatten (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 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
« no previous file with comments | « src/core/SkWriteBuffer.cpp ('k') | tests/FlatDataTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBitmapSource.cpp
diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp
index 6834e9e32e9b5ff46ab6e4c5c0f672c464a35ead..79f6e92c1d80512629ccdb6aa379b95b3ba4db83 100644
--- a/src/effects/SkBitmapSource.cpp
+++ b/src/effects/SkBitmapSource.cpp
@@ -21,15 +21,17 @@ SkBitmapSource::SkBitmapSource(const SkBitmap& bitmap)
}
SkBitmapSource::SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect& dstRect)
- : INHERITED(0, 0),
- fBitmap(bitmap),
- fSrcRect(srcRect),
- fDstRect(dstRect) {
-}
+ : INHERITED(0, 0)
+ , fBitmap(bitmap)
+ , fSrcRect(srcRect)
+ , fDstRect(dstRect) {}
-SkBitmapSource::SkBitmapSource(SkReadBuffer& buffer)
- : INHERITED(0, buffer) {
- fBitmap.unflatten(buffer);
+SkBitmapSource::SkBitmapSource(SkReadBuffer& buffer) : INHERITED(0, buffer) {
+ if (buffer.isVersionLT(SkReadBuffer::kNoMoreBitmapFlatten_Version)) {
+ fBitmap.unflatten(buffer);
+ } else {
+ buffer.readBitmap(&fBitmap);
+ }
buffer.readRect(&fSrcRect);
buffer.readRect(&fDstRect);
buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect(fDstRect));
@@ -37,7 +39,7 @@ SkBitmapSource::SkBitmapSource(SkReadBuffer& buffer)
void SkBitmapSource::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
- fBitmap.flatten(buffer);
+ buffer.writeBitmap(fBitmap);
buffer.writeRect(fSrcRect);
buffer.writeRect(fDstRect);
}
« no previous file with comments | « src/core/SkWriteBuffer.cpp ('k') | tests/FlatDataTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698