OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_OZONE_PLATFORM_CAST_GL_SURFACE_CAST_H_ | 5 #ifndef UI_OZONE_PLATFORM_CAST_GL_SURFACE_CAST_H_ |
6 #define UI_OZONE_PLATFORM_CAST_GL_SURFACE_CAST_H_ | 6 #define UI_OZONE_PLATFORM_CAST_GL_SURFACE_CAST_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/gfx/geometry/size.h" | 9 #include "ui/gfx/geometry/size.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
11 #include "ui/gfx/overlay_transform.h" | 11 #include "ui/gfx/overlay_transform.h" |
12 #include "ui/gfx/swap_result.h" | 12 #include "ui/gfx/swap_result.h" |
13 #include "ui/gl/gl_image.h" | 13 #include "ui/gl/gl_image.h" |
14 #include "ui/gl/gl_surface_egl.h" | 14 #include "ui/gl/gl_surface_egl.h" |
15 | 15 |
16 namespace ui { | 16 namespace ui { |
17 | 17 |
18 class SurfaceFactoryCast; | 18 class SurfaceFactoryCast; |
19 | 19 |
20 class GLSurfaceCast : public gl::NativeViewGLSurfaceEGL { | 20 class GLSurfaceCast : public gl::NativeViewGLSurfaceEGL { |
21 public: | 21 public: |
22 GLSurfaceCast(gfx::AcceleratedWidget widget, SurfaceFactoryCast* parent); | 22 GLSurfaceCast(gfx::AcceleratedWidget widget, SurfaceFactoryCast* parent); |
23 | 23 |
24 // gl::GLSurface: | 24 // gl::GLSurface: |
25 gfx::SwapResult SwapBuffers() override; | 25 gfx::SwapResult SwapBuffers() override; |
26 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; | |
piman
2016/09/07 17:19:41
Did you mean to implement SwapBuffersWithDamage?
halliwell
2016/09/08 04:21:34
Yes, forgot to update this.
| |
26 bool Resize(const gfx::Size& size, | 27 bool Resize(const gfx::Size& size, |
27 float scale_factor, | 28 float scale_factor, |
28 bool has_alpha) override; | 29 bool has_alpha) override; |
29 bool ScheduleOverlayPlane(int z_order, | 30 bool ScheduleOverlayPlane(int z_order, |
30 gfx::OverlayTransform transform, | 31 gfx::OverlayTransform transform, |
31 gl::GLImage* image, | 32 gl::GLImage* image, |
32 const gfx::Rect& bounds_rect, | 33 const gfx::Rect& bounds_rect, |
33 const gfx::RectF& crop_rect) override; | 34 const gfx::RectF& crop_rect) override; |
34 EGLConfig GetConfig() override; | 35 EGLConfig GetConfig() override; |
35 | 36 |
36 protected: | 37 protected: |
37 ~GLSurfaceCast() override; | 38 ~GLSurfaceCast() override; |
38 | 39 |
39 gfx::AcceleratedWidget widget_; | 40 gfx::AcceleratedWidget widget_; |
40 SurfaceFactoryCast* parent_; | 41 SurfaceFactoryCast* parent_; |
41 | 42 |
42 private: | 43 private: |
43 DISALLOW_COPY_AND_ASSIGN(GLSurfaceCast); | 44 DISALLOW_COPY_AND_ASSIGN(GLSurfaceCast); |
44 }; | 45 }; |
45 | 46 |
46 } // namespace ui | 47 } // namespace ui |
47 | 48 |
48 #endif // UI_OZONE_PLATFORM_CAST_GL_SURFACE_CAST_H_ | 49 #endif // UI_OZONE_PLATFORM_CAST_GL_SURFACE_CAST_H_ |
OLD | NEW |