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

Side by Side Diff: tests/BitmapHeapTest.cpp

Issue 1858323002: Enable flattening/unflattening with custom unflatten procs (Closed) Base URL: https://skia.googlesource.com/skia.git@flattenable
Patch Set: Fix test Created 4 years, 8 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/core/SkWriteBuffer.cpp ('k') | tests/FlattenableCustomFactory.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 2012 Google Inc. 2 * Copyright 2012 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBitmapHeap.h" 9 #include "SkBitmapHeap.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // Now clear out the heap, after which it should be empty. 82 // Now clear out the heap, after which it should be empty.
83 heap.freeMemoryIfPossible(~0U); 83 heap.freeMemoryIfPossible(~0U);
84 REPORTER_ASSERT(reporter, heap.count() == 0); 84 REPORTER_ASSERT(reporter, heap.count() == 0);
85 85
86 // Now attempt to flatten the shader again. 86 // Now attempt to flatten the shader again.
87 heap.deferAddingOwners(); 87 heap.deferAddingOwners();
88 index = dictionary.find(*bitmapShader); 88 index = dictionary.find(*bitmapShader);
89 heap.endAddingOwnersDeferral(false); 89 heap.endAddingOwnersDeferral(false);
90 90
91 // The dictionary should report the same index since the new entry is identi cal.
92 // The bitmap heap should contain the bitmap, but with no references. 91 // The bitmap heap should contain the bitmap, but with no references.
93 REPORTER_ASSERT(reporter, 1 == index);
94 REPORTER_ASSERT(reporter, heap.count() == 1); 92 REPORTER_ASSERT(reporter, heap.count() == 1);
95 REPORTER_ASSERT(reporter, SkBitmapHeapTester::GetRefCount(heap.getEntry(0)) == 0); 93 REPORTER_ASSERT(reporter, SkBitmapHeapTester::GetRefCount(heap.getEntry(0)) == 0);
96 } 94 }
OLDNEW
« no previous file with comments | « src/core/SkWriteBuffer.cpp ('k') | tests/FlattenableCustomFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698