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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp

Issue 2343993002: use SkData oriented picture serialize api (Closed)
Patch Set: doh -- use 0u for template bad guesses Created 4 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 | « skia/config/SkUserConfig.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
index cb552f546619255570202bb7c84a4c63b394a800..4f9dbfc7ca6249c366b119a74f4015f4317f8998 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
@@ -10,7 +10,6 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkPictureAnalyzer.h"
-#include "third_party/skia/include/core/SkStream.h"
namespace blink {
@@ -53,15 +52,8 @@ static bool picturesEqual(const SkPicture* picture1, const SkPicture* picture2)
if (picture1->approximateOpCount() != picture2->approximateOpCount())
return false;
- SkDynamicMemoryWStream picture1Serialized;
- picture1->serialize(&picture1Serialized);
- SkDynamicMemoryWStream picture2Serialized;
- picture2->serialize(&picture2Serialized);
- if (picture1Serialized.bytesWritten() != picture2Serialized.bytesWritten())
- return false;
-
- sk_sp<SkData> data1(picture1Serialized.copyToData());
- sk_sp<SkData> data2(picture2Serialized.copyToData());
+ sk_sp<SkData> data1 = picture1->serialize();
+ sk_sp<SkData> data2 = picture2->serialize();
return data1->equals(data2.get());
}
« no previous file with comments | « skia/config/SkUserConfig.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698