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