| OLD | NEW | 
|   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  | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
|  29         SkIPoint         fOffset; |  29         SkIPoint         fOffset; | 
|  30         SkMatrix         fCTM; |  30         SkMatrix         fCTM; | 
|  31     }; |  31     }; | 
|  32  |  32  | 
|  33     /** 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 | 
|  34         layers can be inside nested sub-pictures. |  34         layers can be inside nested sub-pictures. | 
|  35         @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 | 
|  36         @param query       The rectangle that is about to be drawn. |  36         @param query       The rectangle that is about to be drawn. | 
|  37         @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 | 
|  38         @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 | 
 |  39         @param recycled    Out parameter storing layers that need hoisting but n
    ot rendering | 
|  39         @param layerCache The source of new layers |  40         @param layerCache The source of new layers | 
|  40         Return true if any layers are suitable for hoisting; false otherwise |  41         Return true if any layers are suitable for hoisting; false otherwise | 
|  41     */ |  42     */ | 
|  42     static bool FindLayersToHoist(const SkPicture* topLevelPicture, |  43     static bool FindLayersToHoist(const SkPicture* topLevelPicture, | 
|  43                                   const SkRect& query, |  44                                   const SkRect& query, | 
|  44                                   SkTDArray<HoistedLayer>* altased, |  45                                   SkTDArray<HoistedLayer>* altased, | 
|  45                                   SkTDArray<HoistedLayer>* nonAtlased, |  46                                   SkTDArray<HoistedLayer>* nonAtlased, | 
 |  47                                   SkTDArray<HoistedLayer>* recycled, | 
|  46                                   GrLayerCache* layerCache); |  48                                   GrLayerCache* layerCache); | 
|  47  |  49  | 
|  48     /** Draw the specified layers into either the atlas or free floating texture
    s. |  50     /** Draw the specified layers into either the atlas or free floating texture
    s. | 
|  49         @param atlased      The layers to be drawn into the atlas |  51         @param atlased      The layers to be drawn into the atlas | 
|  50         @param nonAtlased   The layers to be drawn into their own textures |  52         @param nonAtlased   The layers to be drawn into their own textures | 
|  51         @oaram replacements The replacement structure to fill in with the render
    ed layer info |  53         @param recycled     Layers that don't need rendering but do need to go i
    nto the  | 
 |  54                             replacements object | 
 |  55         @param replacements The replacement structure to fill in with the render
    ed layer info | 
|  52     */ |  56     */ | 
|  53     static void DrawLayers(const SkTDArray<HoistedLayer>& atlased, |  57     static void DrawLayers(const SkTDArray<HoistedLayer>& atlased, | 
|  54                            const SkTDArray<HoistedLayer>& nonAtlased, |  58                            const SkTDArray<HoistedLayer>& nonAtlased, | 
 |  59                            const SkTDArray<HoistedLayer>& recycled, | 
|  55                            GrReplacements* replacements); |  60                            GrReplacements* replacements); | 
|  56  |  61  | 
|  57     /** Unlock unneeded layers in the layer cache. |  62     /** Unlock unneeded layers in the layer cache. | 
|  58         @param layerCache holder of the locked layers |  63         @param layerCache holder of the locked layers | 
|  59         @param atlased    Unneeded layers in the atlas |  64         @param atlased    Unneeded layers in the atlas | 
|  60         @param nonAtlased Unneeded layers in their own textures |  65         @param nonAtlased Unneeded layers in their own textures | 
 |  66         @param recycled   Unneeded layers that did not require rendering | 
|  61     */ |  67     */ | 
|  62     static void UnlockLayers(GrLayerCache* layerCache, |  68     static void UnlockLayers(GrLayerCache* layerCache, | 
|  63                              const SkTDArray<HoistedLayer>& atlased, |  69                              const SkTDArray<HoistedLayer>& atlased, | 
|  64                              const SkTDArray<HoistedLayer>& nonAtlased); |  70                              const SkTDArray<HoistedLayer>& nonAtlased, | 
 |  71                              const SkTDArray<HoistedLayer>& recycled); | 
|  65 }; |  72 }; | 
|  66  |  73  | 
|  67 #endif |  74 #endif | 
| OLD | NEW |