| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_IO_SURFACE_NS_GL_SURFACE_H_ | 5 #ifndef UI_ACCELERATED_WIDGET_MAC_IO_SURFACE_NS_GL_SURFACE_H_ |
| 6 #define UI_ACCELERATED_WIDGET_MAC_IO_SURFACE_NS_GL_SURFACE_H_ | 6 #define UI_ACCELERATED_WIDGET_MAC_IO_SURFACE_NS_GL_SURFACE_H_ |
| 7 | 7 |
| 8 #include <Cocoa/Cocoa.h> | 8 #include <Cocoa/Cocoa.h> |
| 9 #include <OpenGL/OpenGL.h> | 9 #include <OpenGL/OpenGL.h> |
| 10 | 10 |
| 11 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "ui/accelerated_widget_mac/io_surface_context.h" | 12 #include "ui/accelerated_widget_mac/io_surface_context.h" |
| 13 #include "ui/accelerated_widget_mac/io_surface_texture.h" | 13 #include "ui/accelerated_widget_mac/io_surface_texture.h" |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 | 16 |
| 17 class IOSurfaceNSGLSurface { | 17 class IOSurfaceNSGLSurface { |
| 18 public: | 18 public: |
| 19 static IOSurfaceNSGLSurface* Create(NSView* view); | 19 static IOSurfaceNSGLSurface* Create(NSView* view); |
| 20 ~IOSurfaceNSGLSurface(); | 20 ~IOSurfaceNSGLSurface(); |
| 21 | 21 |
| 22 // Called on the UI thread. | 22 // Called on the UI thread. |
| 23 bool GotFrame(IOSurfaceID io_surface_id, | 23 bool GotFrame(IOSurfaceID io_surface_id, |
| 24 gfx::Size pixel_size, | 24 gfx::Size pixel_size, |
| 25 float scale_factor); | 25 float scale_factor, |
| 26 gfx::Rect pixel_damage_rect); |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 explicit IOSurfaceNSGLSurface( | 29 explicit IOSurfaceNSGLSurface( |
| 29 NSView* view, | 30 NSView* view, |
| 30 base::scoped_nsobject<NSOpenGLContext> ns_gl_context, | 31 base::scoped_nsobject<NSOpenGLContext> ns_gl_context, |
| 31 scoped_refptr<ui::IOSurfaceTexture> iosurface); | 32 scoped_refptr<ui::IOSurfaceTexture> iosurface); |
| 32 NSView* view_; | 33 NSView* view_; |
| 33 scoped_refptr<ui::IOSurfaceTexture> iosurface_; | 34 scoped_refptr<ui::IOSurfaceTexture> iosurface_; |
| 34 base::scoped_nsobject<NSOpenGLContext> ns_gl_context_; | 35 base::scoped_nsobject<NSOpenGLContext> ns_gl_context_; |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 } // namespace ui | 38 } // namespace ui |
| 38 | 39 |
| 39 #endif // UI_ACCELERATED_WIDGET_MAC_IO_SURFACE_NS_GL_SURFACE_H_ | 40 #endif // UI_ACCELERATED_WIDGET_MAC_IO_SURFACE_NS_GL_SURFACE_H_ |
| OLD | NEW |