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

Side by Side Diff: tools/PictureRenderer.cpp

Issue 23480002: R-Tree -- Don't sort draw commands unless specified. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « tests/RTreeTest.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 "PictureRenderer.h" 8 #include "PictureRenderer.h"
9 #include "picture_utils.h" 9 #include "picture_utils.h"
10 #include "SamplePipeControllers.h" 10 #include "SamplePipeControllers.h"
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 //////////////////////////////////////////////////////////////////////////////// /////////////// 783 //////////////////////////////////////////////////////////////////////////////// ///////////////
784 // SkPicture variants for each BBoxHierarchy type 784 // SkPicture variants for each BBoxHierarchy type
785 785
786 class RTreePicture : public SkPicture { 786 class RTreePicture : public SkPicture {
787 public: 787 public:
788 virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE{ 788 virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE{
789 static const int kRTreeMinChildren = 6; 789 static const int kRTreeMinChildren = 6;
790 static const int kRTreeMaxChildren = 11; 790 static const int kRTreeMaxChildren = 11;
791 SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(fWidth), 791 SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(fWidth),
792 SkIntToScalar(fHeight)); 792 SkIntToScalar(fHeight));
793 bool sortDraws = false;
793 return SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren, 794 return SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren,
794 aspectRatio); 795 aspectRatio, sortDraws);
795 } 796 }
796 }; 797 };
797 798
798 SkPicture* PictureRenderer::createPicture() { 799 SkPicture* PictureRenderer::createPicture() {
799 switch (fBBoxHierarchyType) { 800 switch (fBBoxHierarchyType) {
800 case kNone_BBoxHierarchyType: 801 case kNone_BBoxHierarchyType:
801 return SkNEW(SkPicture); 802 return SkNEW(SkPicture);
802 case kRTree_BBoxHierarchyType: 803 case kRTree_BBoxHierarchyType:
803 return SkNEW(RTreePicture); 804 return SkNEW(RTreePicture);
804 case kTileGrid_BBoxHierarchyType: 805 case kTileGrid_BBoxHierarchyType:
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 virtual SkString getConfigNameInternal() SK_OVERRIDE { 852 virtual SkString getConfigNameInternal() SK_OVERRIDE {
852 return SkString("picture_clone"); 853 return SkString("picture_clone");
853 } 854 }
854 }; 855 };
855 856
856 PictureRenderer* CreatePictureCloneRenderer() { 857 PictureRenderer* CreatePictureCloneRenderer() {
857 return SkNEW(PictureCloneRenderer); 858 return SkNEW(PictureCloneRenderer);
858 } 859 }
859 860
860 } // namespace sk_tools 861 } // namespace sk_tools
OLDNEW
« no previous file with comments | « tests/RTreeTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698