Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(800)

Side by Side Diff: ui/gl/gl_surface_ozone.cc

Issue 300023006: ozone: Add OnSwapBuffers hook to SurfaceOzoneEGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/ozone/surface_ozone_egl.h ('k') | ui/ozone/platform/egltest/ozone_platform_egltest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ui/gl/gl_surface.h" 5 #include "ui/gl/gl_surface.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "ui/gfx/native_widget_types.h" 9 #include "ui/gfx/native_widget_types.h"
10 #include "ui/gfx/ozone/surface_factory_ozone.h" 10 #include "ui/gfx/ozone/surface_factory_ozone.h"
(...skipping 13 matching lines...) Expand all
24 GLSurfaceOzoneEGL(scoped_ptr<SurfaceOzoneEGL> ozone_surface) 24 GLSurfaceOzoneEGL(scoped_ptr<SurfaceOzoneEGL> ozone_surface)
25 : NativeViewGLSurfaceEGL(ozone_surface->GetNativeWindow()), 25 : NativeViewGLSurfaceEGL(ozone_surface->GetNativeWindow()),
26 ozone_surface_(ozone_surface.Pass()) {} 26 ozone_surface_(ozone_surface.Pass()) {}
27 27
28 virtual bool Resize(const gfx::Size& size) OVERRIDE { 28 virtual bool Resize(const gfx::Size& size) OVERRIDE {
29 if (!ozone_surface_->ResizeNativeWindow(size)) 29 if (!ozone_surface_->ResizeNativeWindow(size))
30 return false; 30 return false;
31 31
32 return NativeViewGLSurfaceEGL::Resize(size); 32 return NativeViewGLSurfaceEGL::Resize(size);
33 } 33 }
34 virtual bool SwapBuffers() OVERRIDE {
35 if (!NativeViewGLSurfaceEGL::SwapBuffers())
36 return false;
37
38 return ozone_surface_->OnSwapBuffers();
39 }
34 40
35 private: 41 private:
36 virtual ~GLSurfaceOzoneEGL() { 42 virtual ~GLSurfaceOzoneEGL() {
37 Destroy(); // EGL surface must be destroyed before SurfaceOzone 43 Destroy(); // EGL surface must be destroyed before SurfaceOzone
38 } 44 }
39 45
40 // The native surface. Deleting this is allowed to free the EGLNativeWindow. 46 // The native surface. Deleting this is allowed to free the EGLNativeWindow.
41 scoped_ptr<SurfaceOzoneEGL> ozone_surface_; 47 scoped_ptr<SurfaceOzoneEGL> ozone_surface_;
42 48
43 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOzoneEGL); 49 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOzoneEGL);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 NOTREACHED(); 133 NOTREACHED();
128 return NULL; 134 return NULL;
129 } 135 }
130 } 136 }
131 137
132 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 138 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
133 return SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); 139 return SurfaceFactoryOzone::GetInstance()->GetNativeDisplay();
134 } 140 }
135 141
136 } // namespace gfx 142 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/ozone/surface_ozone_egl.h ('k') | ui/ozone/platform/egltest/ozone_platform_egltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698