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

Side by Side Diff: tests/RecordDrawTest.cpp

Issue 490253003: Implement SkPicture::bytesUsed() for SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move to SkPictureUtils, start unit test Created 6 years, 3 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
« src/utils/SkPictureUtils.cpp ('K') | « tests/PictureTest.cpp ('k') | no next file » | 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 2014 Google Inc. 2 * Copyright 2014 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 "Test.h" 8 #include "Test.h"
9 #include "RecordTestUtils.h" 9 #include "RecordTestUtils.h"
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 entries.push(e); 102 entries.push(e);
103 } 103 }
104 virtual int getCount() const SK_OVERRIDE { return entries.count(); } 104 virtual int getCount() const SK_OVERRIDE { return entries.count(); }
105 105
106 virtual void flushDeferredInserts() SK_OVERRIDE {} 106 virtual void flushDeferredInserts() SK_OVERRIDE {}
107 107
108 virtual void search(const SkIRect& query, SkTDArray<void*>* results) const S K_OVERRIDE {} 108 virtual void search(const SkIRect& query, SkTDArray<void*>* results) const S K_OVERRIDE {}
109 virtual void clear() SK_OVERRIDE {} 109 virtual void clear() SK_OVERRIDE {}
110 virtual void rewindInserts() SK_OVERRIDE {} 110 virtual void rewindInserts() SK_OVERRIDE {}
111 virtual int getDepth() const SK_OVERRIDE { return -1; } 111 virtual int getDepth() const SK_OVERRIDE { return -1; }
112 virtual size_t bytesUsed() const SK_OVERRIDE { return 0; }
112 113
113 struct Entry { 114 struct Entry {
114 uintptr_t data; 115 uintptr_t data;
115 SkIRect bounds; 116 SkIRect bounds;
116 }; 117 };
117 SkTDArray<Entry> entries; 118 SkTDArray<Entry> entries;
118 }; 119 };
119 120
120 // This test is not meant to make total sense yet. It's testing the status quo 121 // This test is not meant to make total sense yet. It's testing the status quo
121 // of SkRecordFillBounds(), which itself doesn't make total sense yet. 122 // of SkRecordFillBounds(), which itself doesn't make total sense yet.
(...skipping 11 matching lines...) Expand all
133 134
134 SkRecordFillBounds(record, &bbh); 135 SkRecordFillBounds(record, &bbh);
135 136
136 REPORTER_ASSERT(r, bbh.entries.count() == 5); 137 REPORTER_ASSERT(r, bbh.entries.count() == 5);
137 for (int i = 0; i < bbh.entries.count(); i++) { 138 for (int i = 0; i < bbh.entries.count(); i++) {
138 REPORTER_ASSERT(r, bbh.entries[i].data == (uintptr_t)i); 139 REPORTER_ASSERT(r, bbh.entries[i].data == (uintptr_t)i);
139 140
140 REPORTER_ASSERT(r, bbh.entries[i].bounds == SkIRect::MakeWH(400, 480)); 141 REPORTER_ASSERT(r, bbh.entries[i].bounds == SkIRect::MakeWH(400, 480));
141 } 142 }
142 } 143 }
OLDNEW
« src/utils/SkPictureUtils.cpp ('K') | « tests/PictureTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698