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

Unified Diff: tests/PictureTest.cpp

Issue 1020103005: Preserve texture compression when saving a revised skp from debugger (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 5 years, 9 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 | « gm/displacement.cpp ('k') | tools/PictureRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureTest.cpp
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index ac750e9a85210c77a5935ba198ee3f3a10fb991c..12d9b1559b30d7af970e8e72157c99d49a20744a 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -28,6 +28,7 @@
#include "SkRecord.h"
#include "SkShader.h"
#include "SkStream.h"
+#include "sk_tool_utils.h"
#if SK_SUPPORT_GPU
#include "SkSurface.h"
@@ -830,18 +831,6 @@ static void test_bad_bitmap() {
}
#endif
-// Encodes to PNG, unless there is already encoded data, in which case that gets
-// used.
-// FIXME: Share with PictureRenderer.cpp?
-class PngPixelSerializer : public SkPixelSerializer {
-public:
- bool onUseEncodedData(const void*, size_t) SK_OVERRIDE { return true; }
- SkData* onEncodePixels(const SkImageInfo& info, const void* pixels,
- size_t rowBytes) SK_OVERRIDE {
- return SkImageEncoder::EncodeData(info, pixels, rowBytes, SkImageEncoder::kPNG_Type, 100);
- }
-};
-
static SkData* serialized_picture_from_bitmap(const SkBitmap& bitmap) {
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(bitmap.width()),
@@ -850,7 +839,7 @@ static SkData* serialized_picture_from_bitmap(const SkBitmap& bitmap) {
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
SkDynamicMemoryWStream wStream;
- PngPixelSerializer serializer;
+ sk_tool_utils::PngPixelSerializer serializer;
picture->serialize(&wStream, &serializer);
return wStream.copyToData();
}
« no previous file with comments | « gm/displacement.cpp ('k') | tools/PictureRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698