| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |