| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 bool Initialize(GLSurfaceFormat format) override; | 115 bool Initialize(GLSurfaceFormat format) override; |
| 116 void Destroy() override; | 116 void Destroy() override; |
| 117 bool Resize(const gfx::Size& size, | 117 bool Resize(const gfx::Size& size, |
| 118 float scale_factor, | 118 float scale_factor, |
| 119 bool has_alpha) override; | 119 bool has_alpha) override; |
| 120 bool Recreate() override; | 120 bool Recreate() override; |
| 121 bool IsOffscreen() override; | 121 bool IsOffscreen() override; |
| 122 gfx::SwapResult SwapBuffers() override; | 122 gfx::SwapResult SwapBuffers() override; |
| 123 gfx::Size GetSize() override; | 123 gfx::Size GetSize() override; |
| 124 EGLSurface GetHandle() override; | 124 EGLSurface GetHandle() override; |
| 125 bool SupportsSwapBuffersWithDamage() override; | |
| 126 bool SupportsPostSubBuffer() override; | 125 bool SupportsPostSubBuffer() override; |
| 127 gfx::SwapResult SwapBuffersWithDamage(int x, | |
| 128 int y, | |
| 129 int width, | |
| 130 int height) override; | |
| 131 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; | 126 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; |
| 132 bool SupportsCommitOverlayPlanes() override; | 127 bool SupportsCommitOverlayPlanes() override; |
| 133 gfx::SwapResult CommitOverlayPlanes() override; | 128 gfx::SwapResult CommitOverlayPlanes() override; |
| 134 gfx::VSyncProvider* GetVSyncProvider() override; | 129 gfx::VSyncProvider* GetVSyncProvider() override; |
| 135 bool ScheduleOverlayPlane(int z_order, | 130 bool ScheduleOverlayPlane(int z_order, |
| 136 gfx::OverlayTransform transform, | 131 gfx::OverlayTransform transform, |
| 137 GLImage* image, | 132 GLImage* image, |
| 138 const gfx::Rect& bounds_rect, | 133 const gfx::Rect& bounds_rect, |
| 139 const gfx::RectF& crop_rect) override; | 134 const gfx::RectF& crop_rect) override; |
| 140 bool FlipsVertically() const override; | 135 bool FlipsVertically() const override; |
| 141 bool BuffersFlipped() const override; | 136 bool BuffersFlipped() const override; |
| 142 | 137 |
| 143 // Create a NativeViewGLSurfaceEGL with an externally provided | 138 // Create a NativeViewGLSurfaceEGL with an externally provided |
| 144 // gfx::VSyncProvider. Takes ownership of the gfx::VSyncProvider. | 139 // gfx::VSyncProvider. Takes ownership of the gfx::VSyncProvider. |
| 145 virtual bool Initialize(std::unique_ptr<gfx::VSyncProvider> sync_provider); | 140 virtual bool Initialize(std::unique_ptr<gfx::VSyncProvider> sync_provider); |
| 146 | 141 |
| 147 // Takes care of the platform dependant bits, of any, for creating the window. | 142 // Takes care of the platform dependant bits, of any, for creating the window. |
| 148 virtual bool InitializeNativeWindow(); | 143 virtual bool InitializeNativeWindow(); |
| 149 | 144 |
| 150 protected: | 145 protected: |
| 151 ~NativeViewGLSurfaceEGL() override; | 146 ~NativeViewGLSurfaceEGL() override; |
| 152 | 147 |
| 153 EGLNativeWindowType window_; | 148 EGLNativeWindowType window_; |
| 154 gfx::Size size_; | 149 gfx::Size size_; |
| 155 bool enable_fixed_size_angle_; | 150 bool enable_fixed_size_angle_; |
| 156 | 151 |
| 157 void OnSetSwapInterval(int interval) override; | 152 void OnSetSwapInterval(int interval) override; |
| 153 gfx::SwapResult SwapBuffersWithDamage(const std::vector<int>& rects); |
| 158 | 154 |
| 159 private: | 155 private: |
| 160 // Commit the |pending_overlays_| and clear the vector. Returns false if any | 156 // Commit the |pending_overlays_| and clear the vector. Returns false if any |
| 161 // fail to be committed. | 157 // fail to be committed. |
| 162 bool CommitAndClearPendingOverlays(); | 158 bool CommitAndClearPendingOverlays(); |
| 163 void UpdateSwapInterval(); | 159 void UpdateSwapInterval(); |
| 164 | 160 |
| 165 EGLSurface surface_; | 161 EGLSurface surface_; |
| 166 bool supports_post_sub_buffer_; | 162 bool supports_post_sub_buffer_; |
| 167 bool supports_swap_buffer_with_damage_; | 163 bool supports_swap_buffer_with_damage_; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 ~SurfacelessEGL() override; | 232 ~SurfacelessEGL() override; |
| 237 | 233 |
| 238 private: | 234 private: |
| 239 gfx::Size size_; | 235 gfx::Size size_; |
| 240 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 236 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
| 241 }; | 237 }; |
| 242 | 238 |
| 243 } // namespace gl | 239 } // namespace gl |
| 244 | 240 |
| 245 #endif // UI_GL_GL_SURFACE_EGL_H_ | 241 #endif // UI_GL_GL_SURFACE_EGL_H_ |
| OLD | NEW |