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

Side by Side Diff: tests/ImageTest.cpp

Issue 1373683003: change pixel-serializer to support reencoding existing data Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: I hate this warning Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/images/SkImageEncoder.cpp ('k') | tests/KtxTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 const char* kSerializedData = "serialized"; 113 const char* kSerializedData = "serialized";
114 114
115 class MockSerializer : public SkPixelSerializer { 115 class MockSerializer : public SkPixelSerializer {
116 public: 116 public:
117 MockSerializer(SkData* (*func)()) : fFunc(func), fDidEncode(false) { } 117 MockSerializer(SkData* (*func)()) : fFunc(func), fDidEncode(false) { }
118 118
119 bool didEncode() const { return fDidEncode; } 119 bool didEncode() const { return fDidEncode; }
120 120
121 protected: 121 protected:
122 bool onUseEncodedData(const void*, size_t) override { 122 SkData* onReencodeData(SkData*) override {
123 return false; 123 return nullptr;
124 } 124 }
125 125
126 SkData* onEncodePixels(const SkImageInfo&, const void*, size_t) override { 126 SkData* onEncodePixels(const SkImageInfo&, const void*, size_t) override {
127 fDidEncode = true; 127 fDidEncode = true;
128 return fFunc(); 128 return fFunc();
129 } 129 }
130 130
131 private: 131 private:
132 SkData* (*fFunc)(); 132 SkData* (*fFunc)();
133 bool fDidEncode; 133 bool fDidEncode;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 } 338 }
339 } 339 }
340 340
341 image.reset(nullptr); 341 image.reset(nullptr);
342 { 342 {
343 SkBitmap cachedBitmap; 343 SkBitmap cachedBitmap;
344 REPORTER_ASSERT(reporter, !SkBitmapCache::Find(uniqueID, &cachedBitmap)) ; 344 REPORTER_ASSERT(reporter, !SkBitmapCache::Find(uniqueID, &cachedBitmap)) ;
345 } 345 }
346 } 346 }
347 #endif 347 #endif
OLDNEW
« no previous file with comments | « src/images/SkImageEncoder.cpp ('k') | tests/KtxTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698