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 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 REPORTER_ASSERT(reporter, replayBM.getColor(30, 30) == 0xff000080); | 1240 REPORTER_ASSERT(reporter, replayBM.getColor(30, 30) == 0xff000080); |
1241 REPORTER_ASSERT(reporter, replayBM.getColor(55, 55) == 0xff800000); | 1241 REPORTER_ASSERT(reporter, replayBM.getColor(55, 55) == 0xff800000); |
1242 } | 1242 } |
1243 | 1243 |
1244 struct CountingBBH : public SkBBoxHierarchy { | 1244 struct CountingBBH : public SkBBoxHierarchy { |
1245 mutable int searchCalls; | 1245 mutable int searchCalls; |
1246 SkRect rootBound; | 1246 SkRect rootBound; |
1247 | 1247 |
1248 CountingBBH(const SkRect& bound) : searchCalls(0), rootBound(bound) {} | 1248 CountingBBH(const SkRect& bound) : searchCalls(0), rootBound(bound) {} |
1249 | 1249 |
1250 void search(const SkRect& query, SkTDArray<unsigned>* results) const overrid
e { | 1250 void search(const SkRect& query, SkTDArray<int>* results) const override { |
1251 this->searchCalls++; | 1251 this->searchCalls++; |
1252 } | 1252 } |
1253 | 1253 |
1254 void insert(const SkRect[], int) override {} | 1254 void insert(const SkRect[], int) override {} |
1255 virtual size_t bytesUsed() const override { return 0; } | 1255 virtual size_t bytesUsed() const override { return 0; } |
1256 SkRect getRootBound() const override { return rootBound; } | 1256 SkRect getRootBound() const override { return rootBound; } |
1257 }; | 1257 }; |
1258 | 1258 |
1259 class SpoonFedBBHFactory : public SkBBHFactory { | 1259 class SpoonFedBBHFactory : public SkBBHFactory { |
1260 public: | 1260 public: |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 | 1355 |
1356 SkAutoTDelete<SkStream> rstream(wstream.detachAsStream()); | 1356 SkAutoTDelete<SkStream> rstream(wstream.detachAsStream()); |
1357 SkAutoTUnref<SkPicture> deserializedPicture(SkPicture::CreateFromStream(rstr
eam)); | 1357 SkAutoTUnref<SkPicture> deserializedPicture(SkPicture::CreateFromStream(rstr
eam)); |
1358 | 1358 |
1359 REPORTER_ASSERT(r, SkToBool(deserializedPicture)); | 1359 REPORTER_ASSERT(r, SkToBool(deserializedPicture)); |
1360 REPORTER_ASSERT(r, deserializedPicture->cullRect().left() == 1); | 1360 REPORTER_ASSERT(r, deserializedPicture->cullRect().left() == 1); |
1361 REPORTER_ASSERT(r, deserializedPicture->cullRect().top() == 2); | 1361 REPORTER_ASSERT(r, deserializedPicture->cullRect().top() == 2); |
1362 REPORTER_ASSERT(r, deserializedPicture->cullRect().right() == 3); | 1362 REPORTER_ASSERT(r, deserializedPicture->cullRect().right() == 3); |
1363 REPORTER_ASSERT(r, deserializedPicture->cullRect().bottom() == 4); | 1363 REPORTER_ASSERT(r, deserializedPicture->cullRect().bottom() == 4); |
1364 } | 1364 } |
OLD | NEW |