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

Side by Side Diff: tests/BitmapHeapTest.cpp

Issue 138563004: Move macros from TestClassDef.h to Test.h (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: upload Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/BitmapHasherTest.cpp ('k') | tests/BitmapTest.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"
11 #include "SkFlattenable.h" 11 #include "SkFlattenable.h"
12 #include "SkOrderedWriteBuffer.h" 12 #include "SkOrderedWriteBuffer.h"
13 #include "SkPictureFlat.h" 13 #include "SkPictureFlat.h"
14 #include "SkRefCnt.h" 14 #include "SkRefCnt.h"
15 #include "SkShader.h" 15 #include "SkShader.h"
16 #include "Test.h" 16 #include "Test.h"
17 #include "TestClassDef.h"
18 17
19 struct SkShaderTraits { 18 struct SkShaderTraits {
20 static void flatten(SkOrderedWriteBuffer& buffer, const SkShader& shader) { 19 static void flatten(SkOrderedWriteBuffer& buffer, const SkShader& shader) {
21 buffer.writeFlattenable(&shader); 20 buffer.writeFlattenable(&shader);
22 } 21 }
23 }; 22 };
24 typedef SkFlatDictionary<SkShader, SkShaderTraits> FlatDictionary; 23 typedef SkFlatDictionary<SkShader, SkShaderTraits> FlatDictionary;
25 24
26 class SkBitmapHeapTester { 25 class SkBitmapHeapTester {
27 26
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 heap.deferAddingOwners(); 77 heap.deferAddingOwners();
79 index = dictionary.find(*bitmapShader); 78 index = dictionary.find(*bitmapShader);
80 heap.endAddingOwnersDeferral(false); 79 heap.endAddingOwnersDeferral(false);
81 80
82 // The dictionary should report the same index since the new entry is identi cal. 81 // The dictionary should report the same index since the new entry is identi cal.
83 // The bitmap heap should contain the bitmap, but with no references. 82 // The bitmap heap should contain the bitmap, but with no references.
84 REPORTER_ASSERT(reporter, 1 == index); 83 REPORTER_ASSERT(reporter, 1 == index);
85 REPORTER_ASSERT(reporter, heap.count() == 1); 84 REPORTER_ASSERT(reporter, heap.count() == 1);
86 REPORTER_ASSERT(reporter, SkBitmapHeapTester::GetRefCount(heap.getEntry(0)) == 0); 85 REPORTER_ASSERT(reporter, SkBitmapHeapTester::GetRefCount(heap.getEntry(0)) == 0);
87 } 86 }
OLDNEW
« no previous file with comments | « tests/BitmapHasherTest.cpp ('k') | tests/BitmapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698