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

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

Issue 476303003: Add GLSurfaceOzone's implementation of ScheduleOverlayPlane (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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/gl/gl_context.h" 10 #include "ui/gl/gl_context.h"
11 #include "ui/gl/gl_image.h"
11 #include "ui/gl/gl_implementation.h" 12 #include "ui/gl/gl_implementation.h"
12 #include "ui/gl/gl_surface_egl.h" 13 #include "ui/gl/gl_surface_egl.h"
13 #include "ui/gl/gl_surface_osmesa.h" 14 #include "ui/gl/gl_surface_osmesa.h"
14 #include "ui/gl/gl_surface_stub.h" 15 #include "ui/gl/gl_surface_stub.h"
15 #include "ui/gl/scoped_make_current.h" 16 #include "ui/gl/scoped_make_current.h"
16 #include "ui/ozone/public/surface_factory_ozone.h" 17 #include "ui/ozone/public/surface_factory_ozone.h"
17 #include "ui/ozone/public/surface_ozone_egl.h" 18 #include "ui/ozone/public/surface_ozone_egl.h"
18 19
19 namespace gfx { 20 namespace gfx {
20 21
(...skipping 16 matching lines...) Expand all
37 } 38 }
38 39
39 return NativeViewGLSurfaceEGL::Resize(size); 40 return NativeViewGLSurfaceEGL::Resize(size);
40 } 41 }
41 virtual bool SwapBuffers() OVERRIDE { 42 virtual bool SwapBuffers() OVERRIDE {
42 if (!NativeViewGLSurfaceEGL::SwapBuffers()) 43 if (!NativeViewGLSurfaceEGL::SwapBuffers())
43 return false; 44 return false;
44 45
45 return ozone_surface_->OnSwapBuffers(); 46 return ozone_surface_->OnSwapBuffers();
46 } 47 }
48 virtual bool ScheduleOverlayPlane(int z_order,
49 OverlayTransform transform,
50 GLImage* image,
51 const Rect& bounds_rect,
52 const RectF& crop_rect) OVERRIDE {
53 return image->ScheduleOverlayPlane(
54 widget_, z_order, transform, bounds_rect, crop_rect);
55 }
47 56
48 private: 57 private:
49 virtual ~GLSurfaceOzoneEGL() { 58 virtual ~GLSurfaceOzoneEGL() {
50 Destroy(); // EGL surface must be destroyed before SurfaceOzone 59 Destroy(); // EGL surface must be destroyed before SurfaceOzone
51 } 60 }
52 61
53 bool ReinitializeNativeSurface() { 62 bool ReinitializeNativeSurface() {
54 scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current; 63 scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current;
55 GLContext* current_context = GLContext::GetCurrent(); 64 GLContext* current_context = GLContext::GetCurrent();
56 bool was_current = 65 bool was_current =
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 NOTREACHED(); 176 NOTREACHED();
168 return NULL; 177 return NULL;
169 } 178 }
170 } 179 }
171 180
172 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 181 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
173 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); 182 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay();
174 } 183 }
175 184
176 } // namespace gfx 185 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698