Chromium Code Reviews| 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/IOSurface.h> | 8 #include <IOSurface/IOSurface.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
| 12 #include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h" | 12 #include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h" |
| 13 #include "ui/accelerated_widget_mac/surface_handle_types.h" | |
| 13 #include "ui/events/latency_info.h" | 14 #include "ui/events/latency_info.h" |
| 14 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
| 15 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 17 | 18 |
| 18 #if defined(__OBJC__) | 19 #if defined(__OBJC__) |
| 19 #import <Cocoa/Cocoa.h> | 20 #import <Cocoa/Cocoa.h> |
| 20 #import "base/mac/scoped_nsobject.h" | 21 #import "base/mac/scoped_nsobject.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 base::TimeTicks* timebase, base::TimeDelta* interval) const; | 73 base::TimeTicks* timebase, base::TimeDelta* interval) const; |
| 73 | 74 |
| 74 // Return true if the renderer should not be throttled by GPU back-pressure. | 75 // Return true if the renderer should not be throttled by GPU back-pressure. |
| 75 bool IsRendererThrottlingDisabled() const; | 76 bool IsRendererThrottlingDisabled() const; |
| 76 | 77 |
| 77 // Mark a bracket in which new frames are being pumped in a restricted nested | 78 // Mark a bracket in which new frames are being pumped in a restricted nested |
| 78 // run loop. | 79 // run loop. |
| 79 void BeginPumpingFrames(); | 80 void BeginPumpingFrames(); |
| 80 void EndPumpingFrames(); | 81 void EndPumpingFrames(); |
| 81 | 82 |
| 82 void GotAcceleratedFrame( | 83 void GotAcceleratedFrame(CAContextID ca_context_id, |
|
Ken Russell (switch to Gerrit)
2015/10/23 01:13:13
Could you document that |ca_context_id| and |io_su
| |
| 83 uint64 surface_handle, | 84 base::ScopedCFTypeRef<IOSurfaceRef> io_surface, |
| 84 const std::vector<ui::LatencyInfo>& latency_info, | 85 const std::vector<ui::LatencyInfo>& latency_info, |
| 85 const gfx::Size& pixel_size, | 86 const gfx::Size& pixel_size, |
| 86 float scale_factor, | 87 float scale_factor, |
| 87 const gfx::Rect& pixel_damage_rect, | 88 const gfx::Rect& pixel_damage_rect, |
| 88 const base::Closure& drawn_callback); | 89 const base::Closure& drawn_callback); |
| 89 | 90 |
| 90 void GotIOSurfaceFrame(base::ScopedCFTypeRef<IOSurfaceRef> io_surface, | 91 void GotIOSurfaceFrame(base::ScopedCFTypeRef<IOSurfaceRef> io_surface, |
| 91 const gfx::Size& pixel_size, | 92 const gfx::Size& pixel_size, |
| 92 float scale_factor, | 93 float scale_factor, |
| 93 bool flip_y); | 94 bool flip_y); |
| 94 | 95 |
| 95 private: | 96 private: |
| 96 void GotAcceleratedCAContextFrame(CAContextID ca_context_id, | 97 void GotAcceleratedCAContextFrame(CAContextID ca_context_id, |
| 97 const gfx::Size& pixel_size, | 98 const gfx::Size& pixel_size, |
| 98 float scale_factor); | 99 float scale_factor); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 // Whether surfaces created by the widget should use the glFinish() workaround | 146 // Whether surfaces created by the widget should use the glFinish() workaround |
| 146 // after compositing. | 147 // after compositing. |
| 147 bool needs_gl_finish_workaround_; | 148 bool needs_gl_finish_workaround_; |
| 148 | 149 |
| 149 DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMac); | 150 DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMac); |
| 150 }; | 151 }; |
| 151 | 152 |
| 152 #endif // __OBJC__ | 153 #endif // __OBJC__ |
| 153 | 154 |
| 154 ACCELERATED_WIDGET_MAC_EXPORT | 155 ACCELERATED_WIDGET_MAC_EXPORT |
| 155 void AcceleratedWidgetMacGotAcceleratedFrame( | 156 void AcceleratedWidgetMacGotAcceleratedFrame( |
|
ccameron
2015/10/22 22:16:49
This has some overlay and redundancy with Accelera
Ken Russell (switch to Gerrit)
2015/10/23 01:13:13
Sounds good.
| |
| 156 gfx::AcceleratedWidget widget, uint64 surface_handle, | 157 gfx::AcceleratedWidget widget, |
| 158 CAContextID ca_context_id, | |
| 159 base::ScopedCFTypeRef<IOSurfaceRef> io_surface, | |
| 157 const std::vector<ui::LatencyInfo>& latency_info, | 160 const std::vector<ui::LatencyInfo>& latency_info, |
| 158 const gfx::Size& pixel_size, | 161 const gfx::Size& pixel_size, |
| 159 float scale_factor, | 162 float scale_factor, |
| 160 const gfx::Rect& pixel_damage_rect, | 163 const gfx::Rect& pixel_damage_rect, |
| 161 const base::Closure& drawn_callback, | 164 const base::Closure& drawn_callback, |
| 162 bool* disable_throttling, int* renderer_id, | 165 bool* disable_throttling, |
| 163 base::TimeTicks* vsync_timebase, base::TimeDelta* vsync_interval); | 166 int* renderer_id, |
| 167 base::TimeTicks* vsync_timebase, | |
| 168 base::TimeDelta* vsync_interval); | |
| 164 | 169 |
| 165 ACCELERATED_WIDGET_MAC_EXPORT | 170 ACCELERATED_WIDGET_MAC_EXPORT |
| 166 void AcceleratedWidgetMacGotIOSurfaceFrame( | 171 void AcceleratedWidgetMacGotIOSurfaceFrame( |
| 167 gfx::AcceleratedWidget widget, | 172 gfx::AcceleratedWidget widget, |
| 168 base::ScopedCFTypeRef<IOSurfaceRef> io_surface, | 173 base::ScopedCFTypeRef<IOSurfaceRef> io_surface, |
| 169 const gfx::Size& pixel_size, | 174 const gfx::Size& pixel_size, |
| 170 float scale_factor, | 175 float scale_factor, |
| 171 bool flip_y); | 176 bool flip_y); |
| 172 | 177 |
| 173 } // namespace ui | 178 } // namespace ui |
| 174 | 179 |
| 175 #endif // UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_ | 180 #endif // UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_ |
| OLD | NEW |