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

Unified Diff: tests/BitmapHeapTest.cpp

Issue 723593002: Start stripping out complicated parts of SkPicture{Record,Data}. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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
Index: tests/BitmapHeapTest.cpp
diff --git a/tests/BitmapHeapTest.cpp b/tests/BitmapHeapTest.cpp
index dc9905e9f3604e3d8a5b008192e1639d166d983a..d65ebb67ca8f85648fe81ff8db730354436f3a8c 100644
--- a/tests/BitmapHeapTest.cpp
+++ b/tests/BitmapHeapTest.cpp
@@ -15,6 +15,13 @@
#include "SkShader.h"
#include "Test.h"
+struct SimpleFlatController : public SkFlatController {
+ SimpleFlatController() : SkFlatController() {}
robertphillips 2014/11/12 17:14:42 SK_OVERRIDE on these two ?
+ virtual void* allocThrow(size_t bytes) { return sk_malloc_throw(bytes); }
+ virtual void unalloc(void* ptr) { sk_free(ptr); }
+ void setBitmapStorage(SkBitmapHeap* h) { this->setBitmapHeap(h); }
+};
+
struct SkShaderTraits {
static void Flatten(SkWriteBuffer& buffer, const SkShader& shader) {
buffer.writeFlattenable(&shader);
@@ -23,7 +30,6 @@ struct SkShaderTraits {
typedef SkFlatDictionary<SkShader, SkShaderTraits> FlatDictionary;
class SkBitmapHeapTester {
-
public:
static int32_t GetRefCount(const SkBitmapHeapEntry* entry) {
return entry->fRefCount;
@@ -44,7 +50,7 @@ DEF_TEST(BitmapHeap, reporter) {
// Flatten, storing it in the bitmap heap.
SkBitmapHeap heap(1, 1);
- SkChunkFlatController controller(1024);
+ SimpleFlatController controller;
controller.setBitmapStorage(&heap);
FlatDictionary dictionary(&controller);

Powered by Google App Engine
This is Rietveld 408576698