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

Side by Side Diff: tests/BitmapHeapTest.cpp

Issue 166193006: staticMethod -> StaticMethod (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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/pipe/SkGPipeWrite.cpp ('k') | tests/FlatDataTest.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 "SkWriteBuffer.h" 12 #include "SkWriteBuffer.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 17
18 struct SkShaderTraits { 18 struct SkShaderTraits {
19 static void flatten(SkWriteBuffer& buffer, const SkShader& shader) { 19 static void Flatten(SkWriteBuffer& buffer, const SkShader& shader) {
20 buffer.writeFlattenable(&shader); 20 buffer.writeFlattenable(&shader);
21 } 21 }
22 }; 22 };
23 typedef SkFlatDictionary<SkShader, SkShaderTraits> FlatDictionary; 23 typedef SkFlatDictionary<SkShader, SkShaderTraits> FlatDictionary;
24 24
25 class SkBitmapHeapTester { 25 class SkBitmapHeapTester {
26 26
27 public: 27 public:
28 static int32_t GetRefCount(const SkBitmapHeapEntry* entry) { 28 static int32_t GetRefCount(const SkBitmapHeapEntry* entry) {
29 return entry->fRefCount; 29 return entry->fRefCount;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 heap.deferAddingOwners(); 76 heap.deferAddingOwners();
77 index = dictionary.find(*bitmapShader); 77 index = dictionary.find(*bitmapShader);
78 heap.endAddingOwnersDeferral(false); 78 heap.endAddingOwnersDeferral(false);
79 79
80 // The dictionary should report the same index since the new entry is identi cal. 80 // The dictionary should report the same index since the new entry is identi cal.
81 // The bitmap heap should contain the bitmap, but with no references. 81 // The bitmap heap should contain the bitmap, but with no references.
82 REPORTER_ASSERT(reporter, 1 == index); 82 REPORTER_ASSERT(reporter, 1 == index);
83 REPORTER_ASSERT(reporter, heap.count() == 1); 83 REPORTER_ASSERT(reporter, heap.count() == 1);
84 REPORTER_ASSERT(reporter, SkBitmapHeapTester::GetRefCount(heap.getEntry(0)) == 0); 84 REPORTER_ASSERT(reporter, SkBitmapHeapTester::GetRefCount(heap.getEntry(0)) == 0);
85 } 85 }
OLDNEW
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | tests/FlatDataTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698