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

Side by Side Diff: src/core/SkRTreePicture.cpp

Issue 243173002: Staging for cleanup of SkPicture-related headers (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Add crucial newline at end of file Created 6 years, 8 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 | « src/core/SkQuadTreePicture.cpp ('k') | src/core/SkTileGrid.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 #ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES
9
8 #include "SkRTreePicture.h" 10 #include "SkRTreePicture.h"
9 11
10 #include "SkRTree.h" 12 #include "SkRTree.h"
11 13
12 SkBBoxHierarchy* SkRTreeFactory::operator()(int width, int height) const {
13 // These values were empirically determined to produce reasonable
14 // performance in most cases.
15 static const int kRTreeMinChildren = 6;
16 static const int kRTreeMaxChildren = 11;
17
18 SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(width),
19 SkIntToScalar(height));
20 bool sortDraws = false; // Do not sort draw calls when bulk loading.
21
22 return SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren,
23 aspectRatio, sortDraws);
24 }
25
26 #ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES
27
28 SkBBoxHierarchy* SkRTreePicture::createBBoxHierarchy() const { 14 SkBBoxHierarchy* SkRTreePicture::createBBoxHierarchy() const {
29 // These values were empirically determined to produce reasonable 15 // These values were empirically determined to produce reasonable
30 // performance in most cases. 16 // performance in most cases.
31 static const int kRTreeMinChildren = 6; 17 static const int kRTreeMinChildren = 6;
32 static const int kRTreeMaxChildren = 11; 18 static const int kRTreeMaxChildren = 11;
33 19
34 SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(fWidth), 20 SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(fWidth),
35 SkIntToScalar(fHeight)); 21 SkIntToScalar(fHeight));
36 bool sortDraws = false; // Do not sort draw calls when bulk loading. 22 bool sortDraws = false; // Do not sort draw calls when bulk loading.
37 23
38 return SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren, 24 return SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren,
39 aspectRatio, sortDraws); 25 aspectRatio, sortDraws);
40 } 26 }
41 27
42 #endif 28 #endif
OLDNEW
« no previous file with comments | « src/core/SkQuadTreePicture.cpp ('k') | src/core/SkTileGrid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698