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

Side by Side Diff: tests/PictureTest.cpp

Issue 913833002: Simplify SkBBH::insert API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/core/SkRecordDraw.cpp ('k') | tests/RTreeTest.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 "SkBBoxHierarchy.h" 8 #include "SkBBoxHierarchy.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 1248
1249 struct CountingBBH : public SkBBoxHierarchy { 1249 struct CountingBBH : public SkBBoxHierarchy {
1250 mutable int searchCalls; 1250 mutable int searchCalls;
1251 1251
1252 CountingBBH() : searchCalls(0) {} 1252 CountingBBH() : searchCalls(0) {}
1253 1253
1254 void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVER RIDE { 1254 void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVER RIDE {
1255 this->searchCalls++; 1255 this->searchCalls++;
1256 } 1256 }
1257 1257
1258 void insert(SkAutoTMalloc<SkRect>*, int) SK_OVERRIDE {} 1258 void insert(const SkRect[], int) SK_OVERRIDE {}
1259 virtual size_t bytesUsed() const SK_OVERRIDE { return 0; } 1259 virtual size_t bytesUsed() const SK_OVERRIDE { return 0; }
1260 }; 1260 };
1261 1261
1262 class SpoonFedBBHFactory : public SkBBHFactory { 1262 class SpoonFedBBHFactory : public SkBBHFactory {
1263 public: 1263 public:
1264 explicit SpoonFedBBHFactory(SkBBoxHierarchy* bbh) : fBBH(bbh) {} 1264 explicit SpoonFedBBHFactory(SkBBoxHierarchy* bbh) : fBBH(bbh) {}
1265 SkBBoxHierarchy* operator()(const SkRect&) const SK_OVERRIDE { 1265 SkBBoxHierarchy* operator()(const SkRect&) const SK_OVERRIDE {
1266 return SkRef(fBBH); 1266 return SkRef(fBBH);
1267 } 1267 }
1268 private: 1268 private:
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 1312
1313 // The picture shares the immutable pixels but copies the mutable ones. 1313 // The picture shares the immutable pixels but copies the mutable ones.
1314 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1314 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1315 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); 1315 REPORTER_ASSERT(r, !immut.pixelRef()->unique());
1316 1316
1317 // When the picture goes away, it's just our bitmaps holding the refs. 1317 // When the picture goes away, it's just our bitmaps holding the refs.
1318 pic.reset(NULL); 1318 pic.reset(NULL);
1319 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1319 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1320 REPORTER_ASSERT(r, immut.pixelRef()->unique()); 1320 REPORTER_ASSERT(r, immut.pixelRef()->unique());
1321 } 1321 }
OLDNEW
« no previous file with comments | « src/core/SkRecordDraw.cpp ('k') | tests/RTreeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698