OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_COMPOSITING_VIEW_MAC_H | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_COMPOSITING_VIEW_MAC_H |
6 #define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_COMPOSITING_VIEW_MAC_H | 6 #define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_COMPOSITING_VIEW_MAC_H |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #import <QuartzCore/CVDisplayLink.h> | 9 #import <QuartzCore/CVDisplayLink.h> |
10 #include <QuartzCore/QuartzCore.h> | 10 #include <QuartzCore/QuartzCore.h> |
(...skipping 14 matching lines...) Expand all Loading... | |
25 class Rect; | 25 class Rect; |
26 } | 26 } |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 | 29 |
30 // This class manages an OpenGL context and IOSurface for the accelerated | 30 // This class manages an OpenGL context and IOSurface for the accelerated |
31 // compositing code path. The GL context is attached to | 31 // compositing code path. The GL context is attached to |
32 // RenderWidgetHostViewCocoa for blitting the IOSurface. | 32 // RenderWidgetHostViewCocoa for blitting the IOSurface. |
33 class CompositingIOSurfaceMac { | 33 class CompositingIOSurfaceMac { |
34 public: | 34 public: |
35 // Returns NULL if IOSurface support is missing or GL APIs fail. | 35 // Returns NULL if IOSurface support is missing or GL APIs fail. Pass |true| |
36 static CompositingIOSurfaceMac* Create(); | 36 // to |below_window| if the surface should be ordered below the window. |
37 static CompositingIOSurfaceMac* Create(bool below_window); | |
Nico
2012/11/29 22:23:13
nit: enum parameters read better at the calling si
Avi (use Gerrit)
2012/11/30 04:06:02
Done.
| |
37 ~CompositingIOSurfaceMac(); | 38 ~CompositingIOSurfaceMac(); |
38 | 39 |
39 // Set IOSurface that will be drawn on the next NSView drawRect. | 40 // Set IOSurface that will be drawn on the next NSView drawRect. |
40 void SetIOSurface(uint64 io_surface_handle, | 41 void SetIOSurface(uint64 io_surface_handle, |
41 const gfx::Size& size); | 42 const gfx::Size& size); |
42 | 43 |
43 // Blit the IOSurface at the upper-left corner of the |view|. If |view| window | 44 // Blit the IOSurface at the upper-left corner of the |view|. If |view| window |
44 // size is larger than the IOSurface, the remaining right and bottom edges | 45 // size is larger than the IOSurface, the remaining right and bottom edges |
45 // will be white. |scaleFactor| is 1 in normal views, 2 in HiDPI views. | 46 // will be white. |scaleFactor| is 1 in normal views, 2 in HiDPI views. |
46 void DrawIOSurface(NSView* view, float scale_factor); | 47 void DrawIOSurface(NSView* view, float scale_factor); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 | 274 |
274 // Vsync timing data. | 275 // Vsync timing data. |
275 base::TimeTicks vsync_timebase_; | 276 base::TimeTicks vsync_timebase_; |
276 uint32 vsync_interval_numerator_; | 277 uint32 vsync_interval_numerator_; |
277 uint32 vsync_interval_denominator_; | 278 uint32 vsync_interval_denominator_; |
278 }; | 279 }; |
279 | 280 |
280 } // namespace content | 281 } // namespace content |
281 | 282 |
282 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_COMPOSITING_VIEW_MAC_H | 283 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_COMPOSITING_VIEW_MAC_H |
OLD | NEW |