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

Side by Side Diff: tests/PictureTest.cpp

Issue 722043005: Revert of allow pictures to have a full bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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/SkRecorder.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 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 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE { 1835 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE {
1836 this->searchCalls++; 1836 this->searchCalls++;
1837 } 1837 }
1838 1838
1839 virtual void insert(SkAutoTMalloc<SkRect>*, int) SK_OVERRIDE {} 1839 virtual void insert(SkAutoTMalloc<SkRect>*, int) SK_OVERRIDE {}
1840 }; 1840 };
1841 1841
1842 class SpoonFedBBHFactory : public SkBBHFactory { 1842 class SpoonFedBBHFactory : public SkBBHFactory {
1843 public: 1843 public:
1844 explicit SpoonFedBBHFactory(SkBBoxHierarchy* bbh) : fBBH(bbh) {} 1844 explicit SpoonFedBBHFactory(SkBBoxHierarchy* bbh) : fBBH(bbh) {}
1845 SkBBoxHierarchy* operator()(const SkRect&) const SK_OVERRIDE { 1845 virtual SkBBoxHierarchy* operator()(int width, int height) const {
1846 return SkRef(fBBH); 1846 return SkRef(fBBH);
1847 } 1847 }
1848 private: 1848 private:
1849 SkBBoxHierarchy* fBBH; 1849 SkBBoxHierarchy* fBBH;
1850 }; 1850 };
1851 1851
1852 // When the canvas clip covers the full picture, we don't need to call the BBH. 1852 // When the canvas clip covers the full picture, we don't need to call the BBH.
1853 DEF_TEST(Picture_SkipBBH, r) { 1853 DEF_TEST(Picture_SkipBBH, r) {
1854 CountingBBH bbh; 1854 CountingBBH bbh;
1855 SpoonFedBBHFactory factory(&bbh); 1855 SpoonFedBBHFactory factory(&bbh);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1887 1887
1888 // The picture shares the immutable pixels but copies the mutable ones. 1888 // The picture shares the immutable pixels but copies the mutable ones.
1889 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1889 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1890 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); 1890 REPORTER_ASSERT(r, !immut.pixelRef()->unique());
1891 1891
1892 // When the picture goes away, it's just our bitmaps holding the refs. 1892 // When the picture goes away, it's just our bitmaps holding the refs.
1893 pic.reset(NULL); 1893 pic.reset(NULL);
1894 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1894 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1895 REPORTER_ASSERT(r, immut.pixelRef()->unique()); 1895 REPORTER_ASSERT(r, immut.pixelRef()->unique());
1896 } 1896 }
OLDNEW
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698