| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_ACCELERATED_WIDGET_MAC_CA_LAYER_PARTIAL_DAMAGE_TREE_MAC_H_ | |
| 6 #define UI_ACCELERATED_WIDGET_MAC_CA_LAYER_PARTIAL_DAMAGE_TREE_MAC_H_ | |
| 7 | |
| 8 #include <IOSurface/IOSurface.h> | |
| 9 #include <QuartzCore/QuartzCore.h> | |
| 10 | |
| 11 #include <deque> | |
| 12 #include <memory> | |
| 13 | |
| 14 #include "base/mac/scoped_cftyperef.h" | |
| 15 #include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h" | |
| 16 #include "ui/gfx/geometry/rect.h" | |
| 17 #include "ui/gfx/geometry/rect_f.h" | |
| 18 | |
| 19 namespace ui { | |
| 20 | |
| 21 class ACCELERATED_WIDGET_MAC_EXPORT CALayerPartialDamageTree { | |
| 22 public: | |
| 23 CALayerPartialDamageTree(bool allow_partial_swap, | |
| 24 base::ScopedCFTypeRef<IOSurfaceRef> io_surface, | |
| 25 const gfx::Rect& pixel_frame_rect); | |
| 26 ~CALayerPartialDamageTree(); | |
| 27 | |
| 28 base::ScopedCFTypeRef<IOSurfaceRef> RootLayerIOSurface(); | |
| 29 void CommitCALayers(CALayer* superlayer, | |
| 30 std::unique_ptr<CALayerPartialDamageTree> old_tree, | |
| 31 float scale_factor, | |
| 32 const gfx::Rect& pixel_damage_rect); | |
| 33 | |
| 34 private: | |
| 35 class OverlayPlane; | |
| 36 | |
| 37 // This will populate |partial_damage_planes_|, potentially re-using the | |
| 38 // CALayers and |partial_damage_planes_| from |old_tree|. After this function | |
| 39 // completes, the back() of |partial_damage_planes_| is the plane that will | |
| 40 // be updated this frame (and if it is empty, then the root plane will be | |
| 41 // updated). | |
| 42 void UpdatePartialDamagePlanes(CALayerPartialDamageTree* old_tree, | |
| 43 const gfx::Rect& pixel_damage_rect); | |
| 44 | |
| 45 void UpdateRootAndPartialDamagePlanes( | |
| 46 std::unique_ptr<CALayerPartialDamageTree> old_tree, | |
| 47 const gfx::Rect& pixel_damage_rect); | |
| 48 | |
| 49 void UpdateCALayers(CALayer* superlayer, float scale_factor); | |
| 50 | |
| 51 const bool allow_partial_swap_; | |
| 52 std::unique_ptr<OverlayPlane> root_plane_; | |
| 53 std::deque<std::unique_ptr<OverlayPlane>> partial_damage_planes_; | |
| 54 }; | |
| 55 | |
| 56 } // content | |
| 57 | |
| 58 #endif // GPU_IPC_SERVICE_CA_LAYER_PARTIAL_DAMAGE_TREE_MAC_H_ | |
| OLD | NEW |