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

Side by Side Diff: tests/PictureTest.cpp

Issue 622773003: Demote getCount, getDepth, and clear to RTree-only methods. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: dox Created 6 years, 2 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/SkTileGrid.cpp ('k') | tests/RecordDrawTest.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 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 1865
1866 CountingBBH() : searchCalls(0) {} 1866 CountingBBH() : searchCalls(0) {}
1867 1867
1868 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE { 1868 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE {
1869 this->searchCalls++; 1869 this->searchCalls++;
1870 } 1870 }
1871 1871
1872 // All other methods unimplemented. 1872 // All other methods unimplemented.
1873 virtual void insert(unsigned opIndex, const SkRect& bounds, bool defer) SK_O VERRIDE {} 1873 virtual void insert(unsigned opIndex, const SkRect& bounds, bool defer) SK_O VERRIDE {}
1874 virtual void flushDeferredInserts() SK_OVERRIDE {} 1874 virtual void flushDeferredInserts() SK_OVERRIDE {}
1875 virtual void clear() SK_OVERRIDE {}
1876 virtual int getCount() const SK_OVERRIDE { return 0; }
1877 virtual int getDepth() const SK_OVERRIDE { return 0; }
1878 }; 1875 };
1879 1876
1880 class SpoonFedBBHFactory : public SkBBHFactory { 1877 class SpoonFedBBHFactory : public SkBBHFactory {
1881 public: 1878 public:
1882 explicit SpoonFedBBHFactory(SkBBoxHierarchy* bbh) : fBBH(bbh) {} 1879 explicit SpoonFedBBHFactory(SkBBoxHierarchy* bbh) : fBBH(bbh) {}
1883 virtual SkBBoxHierarchy* operator()(int width, int height) const { 1880 virtual SkBBoxHierarchy* operator()(int width, int height) const {
1884 return SkRef(fBBH); 1881 return SkRef(fBBH);
1885 } 1882 }
1886 private: 1883 private:
1887 SkBBoxHierarchy* fBBH; 1884 SkBBoxHierarchy* fBBH;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 1922
1926 // The picture shares the immutable pixels but copies the mutable ones. 1923 // The picture shares the immutable pixels but copies the mutable ones.
1927 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1924 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1928 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); 1925 REPORTER_ASSERT(r, !immut.pixelRef()->unique());
1929 1926
1930 // When the picture goes away, it's just our bitmaps holding the refs. 1927 // When the picture goes away, it's just our bitmaps holding the refs.
1931 pic.reset(NULL); 1928 pic.reset(NULL);
1932 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1929 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1933 REPORTER_ASSERT(r, immut.pixelRef()->unique()); 1930 REPORTER_ASSERT(r, immut.pixelRef()->unique());
1934 } 1931 }
OLDNEW
« no previous file with comments | « src/core/SkTileGrid.cpp ('k') | tests/RecordDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698