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 CONTENT_COMMON_GPU_CA_LAYER_PARTIAL_DAMAGE_TREE_MAC_H_ |
| 6 #define CONTENT_COMMON_GPU_CA_LAYER_PARTIAL_DAMAGE_TREE_MAC_H_ |
| 7 |
| 8 #include <IOSurface/IOSurface.h> |
| 9 #include <QuartzCore/QuartzCore.h> |
| 10 #include <deque> |
| 11 |
| 12 #include "base/mac/scoped_cftyperef.h" |
| 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "ui/gfx/geometry/rect.h" |
| 16 #include "ui/gfx/geometry/rect_f.h" |
| 17 |
| 18 namespace content { |
| 19 |
| 20 class CALayerPartialDamageTree { |
| 21 public: |
| 22 CALayerPartialDamageTree(bool allow_partial_swap, |
| 23 base::ScopedCFTypeRef<IOSurfaceRef> io_surface, |
| 24 const gfx::Rect& pixel_frame_rect); |
| 25 ~CALayerPartialDamageTree(); |
| 26 |
| 27 base::ScopedCFTypeRef<IOSurfaceRef> RootLayerIOSurface(); |
| 28 void CommitCALayers(CALayer* superlayer, |
| 29 scoped_ptr<CALayerPartialDamageTree> old_tree, |
| 30 float scale_factor, |
| 31 const gfx::Rect& pixel_damage_rect); |
| 32 |
| 33 private: |
| 34 class OverlayPlane; |
| 35 |
| 36 void UpdateRootAndPartialDamagePlanes(CALayerPartialDamageTree* old_tree, |
| 37 const gfx::RectF& pixel_damage_rect); |
| 38 void UpdateRootAndPartialDamageCALayers(CALayer* superlayer, |
| 39 float scale_factor); |
| 40 |
| 41 const bool allow_partial_swap_; |
| 42 linked_ptr<OverlayPlane> root_plane_; |
| 43 std::deque<linked_ptr<OverlayPlane>> partial_damage_planes_; |
| 44 }; |
| 45 |
| 46 } // content |
| 47 |
| 48 #endif // CONTENT_COMMON_GPU_CA_LAYER_PARTIAL_DAMAGE_TREE_MAC_H_ |
OLD | NEW |