| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_ | 5 #ifndef UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_ |
| 6 #define UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_ | 6 #define UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_ |
| 7 | 7 |
| 8 #include <IOSurface/IOSurfaceAPI.h> | 8 #include <IOSurface/IOSurfaceAPI.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h" | 11 #include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h" |
| 12 #include "ui/events/latency_info.h" | 12 #include "ui/events/latency_info.h" |
| 13 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 15 | 16 |
| 16 #if defined(__OBJC__) | 17 #if defined(__OBJC__) |
| 17 #import <Cocoa/Cocoa.h> | 18 #import <Cocoa/Cocoa.h> |
| 18 #import "base/mac/scoped_nsobject.h" | 19 #import "base/mac/scoped_nsobject.h" |
| 19 #import "ui/accelerated_widget_mac/io_surface_layer.h" | 20 #import "ui/accelerated_widget_mac/io_surface_layer.h" |
| 20 #import "ui/accelerated_widget_mac/software_layer.h" | 21 #import "ui/accelerated_widget_mac/software_layer.h" |
| 21 #include "ui/base/cocoa/remote_layer_api.h" | 22 #include "ui/base/cocoa/remote_layer_api.h" |
| 22 #endif // __OBJC__ | 23 #endif // __OBJC__ |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 bool IsRendererThrottlingDisabled() const; | 72 bool IsRendererThrottlingDisabled() const; |
| 72 | 73 |
| 73 // Mark a bracket in which new frames are being pumped in a restricted nested | 74 // Mark a bracket in which new frames are being pumped in a restricted nested |
| 74 // run loop. | 75 // run loop. |
| 75 void BeginPumpingFrames(); | 76 void BeginPumpingFrames(); |
| 76 void EndPumpingFrames(); | 77 void EndPumpingFrames(); |
| 77 | 78 |
| 78 void GotAcceleratedFrame( | 79 void GotAcceleratedFrame( |
| 79 uint64 surface_handle, | 80 uint64 surface_handle, |
| 80 const std::vector<ui::LatencyInfo>& latency_info, | 81 const std::vector<ui::LatencyInfo>& latency_info, |
| 81 gfx::Size pixel_size, | 82 const gfx::Size& pixel_size, |
| 82 float scale_factor, | 83 float scale_factor, |
| 84 const gfx::Rect& pixel_damage_rect, |
| 83 const base::Closure& drawn_callback); | 85 const base::Closure& drawn_callback); |
| 84 | 86 |
| 85 void GotSoftwareFrame(float scale_factor, SkCanvas* canvas); | 87 void GotSoftwareFrame(float scale_factor, SkCanvas* canvas); |
| 86 | 88 |
| 87 private: | 89 private: |
| 88 // IOSurfaceLayerClient implementation: | 90 // IOSurfaceLayerClient implementation: |
| 89 bool IOSurfaceLayerShouldAckImmediately() const override; | 91 bool IOSurfaceLayerShouldAckImmediately() const override; |
| 90 void IOSurfaceLayerDidDrawFrame() override; | 92 void IOSurfaceLayerDidDrawFrame() override; |
| 91 void IOSurfaceLayerHitError() override; | 93 void IOSurfaceLayerHitError() override; |
| 92 | 94 |
| 93 void GotAcceleratedCAContextFrame( | 95 void GotAcceleratedCAContextFrame(CAContextID ca_context_id, |
| 94 CAContextID ca_context_id, gfx::Size pixel_size, float scale_factor); | 96 const gfx::Size& pixel_size, |
| 97 float scale_factor); |
| 95 | 98 |
| 96 void GotAcceleratedIOSurfaceFrame( | 99 void GotAcceleratedIOSurfaceFrame(IOSurfaceID io_surface_id, |
| 97 IOSurfaceID io_surface_id, gfx::Size pixel_size, float scale_factor); | 100 const gfx::Size& pixel_size, |
| 101 float scale_factor); |
| 98 | 102 |
| 99 void GotAcceleratedIOSurfaceFrameNSGL( | 103 void GotAcceleratedIOSurfaceFrameNSGL( |
| 100 IOSurfaceID io_surface_id, gfx::Size pixel_size, float scale_factor); | 104 IOSurfaceID io_surface_id, const gfx::Size& pixel_size, |
| 105 float scale_factor, const gfx::Rect& pixel_damage_rect); |
| 101 | 106 |
| 102 void AcknowledgeAcceleratedFrame(); | 107 void AcknowledgeAcceleratedFrame(); |
| 103 | 108 |
| 104 // Remove a layer from the heirarchy and destroy it. Because the accelerated | 109 // Remove a layer from the heirarchy and destroy it. Because the accelerated |
| 105 // layer types may be replaced by a layer of the same type, the layer to | 110 // layer types may be replaced by a layer of the same type, the layer to |
| 106 // destroy is parameterized, and, if it is the current layer, the current | 111 // destroy is parameterized, and, if it is the current layer, the current |
| 107 // layer is reset. | 112 // layer is reset. |
| 108 void DestroyCAContextLayer( | 113 void DestroyCAContextLayer( |
| 109 base::scoped_nsobject<CALayerHost> ca_context_layer); | 114 base::scoped_nsobject<CALayerHost> ca_context_layer); |
| 110 void DestroyIOSurfaceLayer( | 115 void DestroyIOSurfaceLayer( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 158 |
| 154 DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMac); | 159 DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMac); |
| 155 }; | 160 }; |
| 156 | 161 |
| 157 #endif // __OBJC__ | 162 #endif // __OBJC__ |
| 158 | 163 |
| 159 ACCELERATED_WIDGET_MAC_EXPORT | 164 ACCELERATED_WIDGET_MAC_EXPORT |
| 160 void AcceleratedWidgetMacGotAcceleratedFrame( | 165 void AcceleratedWidgetMacGotAcceleratedFrame( |
| 161 gfx::AcceleratedWidget widget, uint64 surface_handle, | 166 gfx::AcceleratedWidget widget, uint64 surface_handle, |
| 162 const std::vector<ui::LatencyInfo>& latency_info, | 167 const std::vector<ui::LatencyInfo>& latency_info, |
| 163 gfx::Size pixel_size, float scale_factor, | 168 const gfx::Size& pixel_size, |
| 169 float scale_factor, |
| 170 const gfx::Rect& pixel_damage_rect, |
| 164 const base::Closure& drawn_callback, | 171 const base::Closure& drawn_callback, |
| 165 bool* disable_throttling, int* renderer_id); | 172 bool* disable_throttling, int* renderer_id); |
| 166 | 173 |
| 167 ACCELERATED_WIDGET_MAC_EXPORT | 174 ACCELERATED_WIDGET_MAC_EXPORT |
| 168 void AcceleratedWidgetMacGotSoftwareFrame( | 175 void AcceleratedWidgetMacGotSoftwareFrame( |
| 169 gfx::AcceleratedWidget widget, float scale_factor, SkCanvas* canvas); | 176 gfx::AcceleratedWidget widget, float scale_factor, SkCanvas* canvas); |
| 170 | 177 |
| 171 } // namespace ui | 178 } // namespace ui |
| 172 | 179 |
| 173 #endif // UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_ | 180 #endif // UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_ |
| OLD | NEW |