| 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 UI_GL_GL_SURFACE_EGL_H_ | 5 #ifndef UI_GL_GL_SURFACE_EGL_H_ |
| 6 #define UI_GL_GL_SURFACE_EGL_H_ | 6 #define UI_GL_GL_SURFACE_EGL_H_ |
| 7 | 7 |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif | 10 #endif |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 bool SupportsPostSubBuffer() override; | 91 bool SupportsPostSubBuffer() override; |
| 92 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; | 92 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; |
| 93 bool SupportsCommitOverlayPlanes() override; | 93 bool SupportsCommitOverlayPlanes() override; |
| 94 gfx::SwapResult CommitOverlayPlanes() override; | 94 gfx::SwapResult CommitOverlayPlanes() override; |
| 95 VSyncProvider* GetVSyncProvider() override; | 95 VSyncProvider* GetVSyncProvider() override; |
| 96 bool ScheduleOverlayPlane(int z_order, | 96 bool ScheduleOverlayPlane(int z_order, |
| 97 OverlayTransform transform, | 97 OverlayTransform transform, |
| 98 gl::GLImage* image, | 98 gl::GLImage* image, |
| 99 const Rect& bounds_rect, | 99 const Rect& bounds_rect, |
| 100 const RectF& crop_rect) override; | 100 const RectF& crop_rect) override; |
| 101 bool FlipsVertically() const override; |
| 101 | 102 |
| 102 // Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider. | 103 // Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider. |
| 103 // Takes ownership of the VSyncProvider. | 104 // Takes ownership of the VSyncProvider. |
| 104 virtual bool Initialize(scoped_ptr<VSyncProvider> sync_provider); | 105 virtual bool Initialize(scoped_ptr<VSyncProvider> sync_provider); |
| 105 | 106 |
| 106 // Takes care of the platform dependant bits, of any, for creating the window. | 107 // Takes care of the platform dependant bits, of any, for creating the window. |
| 107 virtual bool InitializeNativeWindow(); | 108 virtual bool InitializeNativeWindow(); |
| 108 | 109 |
| 109 protected: | 110 protected: |
| 110 ~NativeViewGLSurfaceEGL() override; | 111 ~NativeViewGLSurfaceEGL() override; |
| 111 | 112 |
| 112 EGLNativeWindowType window_; | 113 EGLNativeWindowType window_; |
| 113 EGLConfig config_; | 114 EGLConfig config_; |
| 114 gfx::Size size_; | 115 gfx::Size size_; |
| 115 | 116 |
| 116 void OnSetSwapInterval(int interval) override; | 117 void OnSetSwapInterval(int interval) override; |
| 117 | 118 |
| 118 private: | 119 private: |
| 119 // Commit the |pending_overlays_| and clear the vector. Returns false if any | 120 // Commit the |pending_overlays_| and clear the vector. Returns false if any |
| 120 // fail to be committed. | 121 // fail to be committed. |
| 121 bool CommitAndClearPendingOverlays(); | 122 bool CommitAndClearPendingOverlays(); |
| 122 | 123 |
| 123 EGLSurface surface_; | 124 EGLSurface surface_; |
| 124 bool supports_post_sub_buffer_; | 125 bool supports_post_sub_buffer_; |
| 125 bool alpha_; | 126 bool alpha_; |
| 127 bool flips_vertically_; |
| 126 | 128 |
| 127 scoped_ptr<VSyncProvider> vsync_provider_; | 129 scoped_ptr<VSyncProvider> vsync_provider_; |
| 128 | 130 |
| 129 int swap_interval_; | 131 int swap_interval_; |
| 130 | 132 |
| 131 std::vector<GLSurfaceOverlay> pending_overlays_; | 133 std::vector<GLSurfaceOverlay> pending_overlays_; |
| 132 | 134 |
| 133 #if defined(OS_WIN) | 135 #if defined(OS_WIN) |
| 134 bool vsync_override_; | 136 bool vsync_override_; |
| 135 | 137 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 ~SurfacelessEGL() override; | 197 ~SurfacelessEGL() override; |
| 196 | 198 |
| 197 private: | 199 private: |
| 198 gfx::Size size_; | 200 gfx::Size size_; |
| 199 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 201 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
| 200 }; | 202 }; |
| 201 | 203 |
| 202 } // namespace gfx | 204 } // namespace gfx |
| 203 | 205 |
| 204 #endif // UI_GL_GL_SURFACE_EGL_H_ | 206 #endif // UI_GL_GL_SURFACE_EGL_H_ |
| OLD | NEW |