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

Side by Side Diff: src/gpu/GrLayerHoister.h

Issue 609403003: Move offset and CTM from LayerCache Key to per-hoisted-layer info (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/gpu/GrLayerCache.cpp ('k') | src/gpu/GrLayerHoister.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 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 #ifndef GrLayerHoister_DEFINED 8 #ifndef GrLayerHoister_DEFINED
9 #define GrLayerHoister_DEFINED 9 #define GrLayerHoister_DEFINED
10 10
11 #include "SkPicture.h" 11 #include "SkPicture.h"
12 #include "SkTDArray.h" 12 #include "SkTDArray.h"
13 13
14 class GrAccelData; 14 class GrAccelData;
15 struct GrCachedLayer; 15 struct GrCachedLayer;
16 class GrReplacements; 16 class GrReplacements;
17 struct SkRect; 17 struct SkRect;
18 18
19 // This class collects the layer hoisting functionality in one place. 19 // This class collects the layer hoisting functionality in one place.
20 // For each picture rendering: 20 // For each picture rendering:
21 // FindLayersToHoist should be called once to collect the required layers 21 // FindLayersToHoist should be called once to collect the required layers
22 // DrawLayers should be called once to render them 22 // DrawLayers should be called once to render them
23 // UnlockLayers should be called once to allow the texture resources to be recy cled 23 // UnlockLayers should be called once to allow the texture resources to be recy cled
24 class GrLayerHoister { 24 class GrLayerHoister {
25 public: 25 public:
26 struct HoistedLayer { 26 struct HoistedLayer {
27 const SkPicture* fPicture; 27 const SkPicture* fPicture;
28 GrCachedLayer* fLayer; 28 GrCachedLayer* fLayer;
29 SkIPoint fOffset;
30 SkMatrix fCTM;
29 }; 31 };
30 32
31 /** Find the layers in 'topLevelPicture' that need hoisting. Note that the d iscovered 33 /** Find the layers in 'topLevelPicture' that need hoisting. Note that the d iscovered
32 layers can be inside nested sub-pictures. 34 layers can be inside nested sub-pictures.
33 @param topLevelPicture The top-level picture that is about to be rendere d 35 @param topLevelPicture The top-level picture that is about to be rendere d
34 @param query The rectangle that is about to be drawn. 36 @param query The rectangle that is about to be drawn.
35 @param atlased Out parameter storing the layers that should be hoist ed to the atlas 37 @param atlased Out parameter storing the layers that should be hoist ed to the atlas
36 @param nonAtlased Out parameter storing the layers that should be hoist ed stand alone 38 @param nonAtlased Out parameter storing the layers that should be hoist ed stand alone
37 @param layerCache The source of new layers 39 @param layerCache The source of new layers
38 Return true if any layers are suitable for hoisting; false otherwise 40 Return true if any layers are suitable for hoisting; false otherwise
(...skipping 17 matching lines...) Expand all
56 @param layerCache holder of the locked layers 58 @param layerCache holder of the locked layers
57 @param atlased Unneeded layers in the atlas 59 @param atlased Unneeded layers in the atlas
58 @param nonAtlased Unneeded layers in their own textures 60 @param nonAtlased Unneeded layers in their own textures
59 */ 61 */
60 static void UnlockLayers(GrLayerCache* layerCache, 62 static void UnlockLayers(GrLayerCache* layerCache,
61 const SkTDArray<HoistedLayer>& atlased, 63 const SkTDArray<HoistedLayer>& atlased,
62 const SkTDArray<HoistedLayer>& nonAtlased); 64 const SkTDArray<HoistedLayer>& nonAtlased);
63 }; 65 };
64 66
65 #endif 67 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrLayerCache.cpp ('k') | src/gpu/GrLayerHoister.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698