OLD | NEW |
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 Loading... |
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 SkData* onReencodeData(SkData*) override { | 122 bool onUseEncodedData(const void*, size_t) override { |
123 return nullptr; | 123 return false; |
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 Loading... |
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 |
OLD | NEW |