Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: ui/accelerated_widget_mac/accelerated_widget_mac.h

Issue 1161853006: Mac: Add partial swap support to NSOpenGLContext path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Expand ifdefs Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 gfx::Size pixel_size,
82 float scale_factor, 83 float scale_factor,
84 gfx::Rect pixel_damage_rect,
dcheng 2015/06/05 23:31:41 I think gfx::rect (and gfx::Size) are usually pass
ccameron 2015/06/07 19:48:23 Done -- also changed all other functions' gfx::Siz
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(
94 CAContextID ca_context_id, gfx::Size pixel_size, float scale_factor); 96 CAContextID ca_context_id, gfx::Size pixel_size, float scale_factor);
95 97
96 void GotAcceleratedIOSurfaceFrame( 98 void GotAcceleratedIOSurfaceFrame(
97 IOSurfaceID io_surface_id, gfx::Size pixel_size, float scale_factor); 99 IOSurfaceID io_surface_id, gfx::Size pixel_size, float scale_factor);
98 100
99 void GotAcceleratedIOSurfaceFrameNSGL( 101 void GotAcceleratedIOSurfaceFrameNSGL(
100 IOSurfaceID io_surface_id, gfx::Size pixel_size, float scale_factor); 102 IOSurfaceID io_surface_id, gfx::Size pixel_size, float scale_factor,
103 gfx::Rect pixel_damage_rect);
dcheng 2015/06/05 23:31:41 Ditto to passing by reference here and elsewhere.
ccameron 2015/06/07 19:48:23 Done.
101 104
102 void AcknowledgeAcceleratedFrame(); 105 void AcknowledgeAcceleratedFrame();
103 106
104 // Remove a layer from the heirarchy and destroy it. Because the accelerated 107 // 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 108 // 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 109 // destroy is parameterized, and, if it is the current layer, the current
107 // layer is reset. 110 // layer is reset.
108 void DestroyCAContextLayer( 111 void DestroyCAContextLayer(
109 base::scoped_nsobject<CALayerHost> ca_context_layer); 112 base::scoped_nsobject<CALayerHost> ca_context_layer);
110 void DestroyIOSurfaceLayer( 113 void DestroyIOSurfaceLayer(
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 156
154 DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMac); 157 DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMac);
155 }; 158 };
156 159
157 #endif // __OBJC__ 160 #endif // __OBJC__
158 161
159 ACCELERATED_WIDGET_MAC_EXPORT 162 ACCELERATED_WIDGET_MAC_EXPORT
160 void AcceleratedWidgetMacGotAcceleratedFrame( 163 void AcceleratedWidgetMacGotAcceleratedFrame(
161 gfx::AcceleratedWidget widget, uint64 surface_handle, 164 gfx::AcceleratedWidget widget, uint64 surface_handle,
162 const std::vector<ui::LatencyInfo>& latency_info, 165 const std::vector<ui::LatencyInfo>& latency_info,
163 gfx::Size pixel_size, float scale_factor, 166 gfx::Size pixel_size, float scale_factor, gfx::Rect pixel_damage_rect,
164 const base::Closure& drawn_callback, 167 const base::Closure& drawn_callback,
165 bool* disable_throttling, int* renderer_id); 168 bool* disable_throttling, int* renderer_id);
166 169
167 ACCELERATED_WIDGET_MAC_EXPORT 170 ACCELERATED_WIDGET_MAC_EXPORT
168 void AcceleratedWidgetMacGotSoftwareFrame( 171 void AcceleratedWidgetMacGotSoftwareFrame(
169 gfx::AcceleratedWidget widget, float scale_factor, SkCanvas* canvas); 172 gfx::AcceleratedWidget widget, float scale_factor, SkCanvas* canvas);
170 173
171 } // namespace ui 174 } // namespace ui
172 175
173 #endif // UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_ 176 #endif // UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698