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

Side by Side Diff: ui/base/ozone/surface_factory_ozone.cc

Issue 13886018: Add a factory and defines for native Linux surfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: vsync provider, better transport_dib, etc. Created 7 years, 7 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/base/ozone/surface_factory_ozone.h"
6
7 #include "base/memory/singleton.h"
8 #include "ui/base/ozone/surface_factory_delegate_ozone.h"
9
10 namespace ui {
11
12 SurfaceFactory::SurfaceFactory() {
13 }
14
15 SurfaceFactory::~SurfaceFactory() {
16 }
17
18 SurfaceFactory* SurfaceFactory::GetInstance() {
19 return Singleton<SurfaceFactory>::get();
20 }
21
22 void SurfaceFactory::SetDelegate(
23 SurfaceFactoryDelegate* delegate) {
24 delegate_.reset(delegate);
25 }
26
27 const char* SurfaceFactory::DefaultDisplaySpec() {
28 return getenv("ASH_DISPLAY_SPEC") ?: "720x1280*2";
29 }
30
31 void SurfaceFactory::InitializeHardware() {
32 if (delegate_)
33 delegate_->InitializeHardware();
34 }
35
36 void SurfaceFactory::ShutdownHardware() {
37 if (delegate_)
38 delegate_->ShutdownHardware();
39 }
40
41 gfx::AcceleratedWidget SurfaceFactory::GetAcceleratedWidget(
42 const gfx::GLSurfaceHandle& handle) {
43 if (delegate_) {
44 return delegate_->GetAcceleratedWidget(handle);
45 } else {
46 // TODO(rjkroege): Return appropriate AccleratedWidget for a
47 // KMS/DRM-backed native accelerated widget.
48 NOTIMPLEMENTED();
49 return (gfx::AcceleratedWidget)0;
piman 2013/05/18 01:47:19 nit: no c-style cast
rjkroege 2013/05/21 17:36:28 Removed in implementation of other suggestion. :-)
50 }
51 }
52
53 bool SurfaceFactory::LoadEGLGLES2Bindings() {
54 if (delegate_)
55 return delegate_->LoadEGLGLES2Bindings();
56 // TODO(rjkroege): Setup bindings for KMS/DRM GLES/EGL.
57 return false;
58 }
59
60 bool SurfaceFactory::AcceleratedWidgetCanBeResized(
61 gfx::AcceleratedWidget w) {
62 if (delegate_)
63 return delegate_->AcceleratedWidgetCanBeResized(w);
64 return false;
65 }
66
67 gfx::VSyncProvider*
68 SurfaceFactory::GetVSyncProvider(gfx::AcceleratedWidget w) {
69 if (delegate_)
70 return delegate_->GetVSyncProvider(w);
71 return NULL;
72 }
73
74 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698