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_COMPOSITING_IOSURFACE_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_MAC_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_MAC_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // Returns NULL if IOSurface support is missing or GL APIs fail. Specify in | 53 // Returns NULL if IOSurface support is missing or GL APIs fail. Specify in |
54 // |order| the desired ordering relationship of the surface to the containing | 54 // |order| the desired ordering relationship of the surface to the containing |
55 // window. | 55 // window. |
56 static CompositingIOSurfaceMac* Create(int window_number, | 56 static CompositingIOSurfaceMac* Create(int window_number, |
57 SurfaceOrder order); | 57 SurfaceOrder order); |
58 ~CompositingIOSurfaceMac(); | 58 ~CompositingIOSurfaceMac(); |
59 | 59 |
60 // Set IOSurface that will be drawn on the next NSView drawRect. | 60 // Set IOSurface that will be drawn on the next NSView drawRect. |
61 void SetIOSurface(uint64 io_surface_handle, | 61 void SetIOSurface(uint64 io_surface_handle, |
62 const gfx::Size& size); | 62 const gfx::Size& size, |
| 63 float scale_factor); |
63 | 64 |
64 // Get the CGL renderer ID currently associated with this context. | 65 // Get the CGL renderer ID currently associated with this context. |
65 int GetRendererID(); | 66 int GetRendererID(); |
66 | 67 |
67 // Blit the IOSurface at the upper-left corner of the |view|. If |view| window | 68 // Blit the IOSurface at the upper-left corner of the |view|. If |view| window |
68 // size is larger than the IOSurface, the remaining right and bottom edges | 69 // size is larger than the IOSurface, the remaining right and bottom edges |
69 // will be white. |scaleFactor| is 1 in normal views, 2 in HiDPI views. | 70 // will be white. |scaleFactor| is 1 in normal views, 2 in HiDPI views. |
70 // |frame_subscriber| listens to this draw event and provides output buffer | 71 // |frame_subscriber| listens to this draw event and provides output buffer |
71 // for copying this frame into. | 72 // for copying this frame into. |
72 void DrawIOSurface(NSView* view, | 73 void DrawIOSurface(NSView* view, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void ClearDrawable(); | 109 void ClearDrawable(); |
109 | 110 |
110 bool HasIOSurface() { return !!io_surface_.get(); } | 111 bool HasIOSurface() { return !!io_surface_.get(); } |
111 | 112 |
112 const gfx::Size& pixel_io_surface_size() const { | 113 const gfx::Size& pixel_io_surface_size() const { |
113 return pixel_io_surface_size_; | 114 return pixel_io_surface_size_; |
114 } | 115 } |
115 // In cocoa view units / DIPs. | 116 // In cocoa view units / DIPs. |
116 const gfx::Size& io_surface_size() const { return io_surface_size_; } | 117 const gfx::Size& io_surface_size() const { return io_surface_size_; } |
117 | 118 |
118 void SetDeviceScaleFactor(float scale_factor); | |
119 | |
120 bool is_vsync_disabled() const; | 119 bool is_vsync_disabled() const; |
121 | 120 |
122 // Get vsync scheduling parameters. | 121 // Get vsync scheduling parameters. |
123 // |interval_numerator/interval_denominator| equates to fractional number of | 122 // |interval_numerator/interval_denominator| equates to fractional number of |
124 // seconds between vsyncs. | 123 // seconds between vsyncs. |
125 void GetVSyncParameters(base::TimeTicks* timebase, | 124 void GetVSyncParameters(base::TimeTicks* timebase, |
126 uint32* interval_numerator, | 125 uint32* interval_numerator, |
127 uint32* interval_denominator); | 126 uint32* interval_denominator); |
128 | 127 |
129 // Returns true if asynchronous readback is supported on this system. | 128 // Returns true if asynchronous readback is supported on this system. |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 uint32 vsync_interval_denominator_; | 357 uint32 vsync_interval_denominator_; |
359 | 358 |
360 bool initialized_is_intel_; | 359 bool initialized_is_intel_; |
361 bool is_intel_; | 360 bool is_intel_; |
362 GLint screen_; | 361 GLint screen_; |
363 }; | 362 }; |
364 | 363 |
365 } // namespace content | 364 } // namespace content |
366 | 365 |
367 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_MAC_H_ | 366 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_MAC_H_ |
OLD | NEW |