Chromium Code Reviews| OLD | NEW |
|---|---|
| (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/linux/native_surface_linux_factory.h" | |
| 6 | |
| 7 #include "base/memory/singleton.h" | |
| 8 #include "ui/base/linux/native_surface_linux_factory_delegate.h" | |
| 9 | |
| 10 namespace ui { | |
| 11 | |
| 12 NativeSurfaceLinuxFactory::NativeSurfaceLinuxFactory() { | |
| 13 } | |
| 14 | |
| 15 NativeSurfaceLinuxFactory::~NativeSurfaceLinuxFactory() { | |
| 16 } | |
| 17 | |
| 18 NativeSurfaceLinuxFactory* NativeSurfaceLinuxFactory::GetInstance() { | |
| 19 return Singleton<NativeSurfaceLinuxFactory>::get(); | |
| 20 } | |
| 21 | |
| 22 void NativeSurfaceLinuxFactory::SetDelegate( | |
| 23 NativeSurfaceLinuxFactoryDelegate* delegate) { | |
| 24 delegate_.reset(delegate); | |
| 25 } | |
| 26 | |
| 27 const char* NativeSurfaceLinuxFactory::DefaultDisplaySpec() { | |
| 28 return getenv("ASH_DISPLAY_SPEC") ?: "720x1280*2"; | |
| 29 } | |
| 30 | |
| 31 void NativeSurfaceLinuxFactory::InitializeHardware() { | |
| 32 if (delegate_) { | |
| 33 delegate_->InitializeHardware(); | |
|
DaveMoore
2013/04/30 17:53:42
Nit: no braces (other places in file too).
rjkroege
2013/05/06 18:46:24
Done.
| |
| 34 } | |
| 35 } | |
| 36 | |
| 37 void NativeSurfaceLinuxFactory::ShutdownHardware() { | |
| 38 if (delegate_) { | |
| 39 delegate_->ShutdownHardware(); | |
| 40 } | |
| 41 } | |
| 42 | |
| 43 gfx::AcceleratedWidget NativeSurfaceLinuxFactory::GetAcceleratedWidget( | |
| 44 const gfx::GLSurfaceHandle& handle) { | |
| 45 if (delegate_) { | |
| 46 return delegate_->GetAcceleratedWidget(handle); | |
| 47 } else { | |
| 48 // TODO(rjkroege): Return appropriate AccleratedWidget for a | |
| 49 // KMS/DRM-backed native accelerated widget. | |
| 50 NOTIMPLEMENTED(); | |
| 51 return (gfx::AcceleratedWidget)0; | |
| 52 } | |
| 53 } | |
| 54 | |
| 55 bool NativeSurfaceLinuxFactory::LoadEGLGLES2Bindings() { | |
| 56 if (delegate_) { | |
| 57 return delegate_->LoadEGLGLES2Bindings(); | |
| 58 } | |
| 59 // TODO(rjkroege): Setup bindings for KMS/DRM GLES/EGL. | |
| 60 return false; | |
| 61 } | |
| 62 | |
| 63 bool NativeSurfaceLinuxFactory::AcceleratedWidgetCanBeResized( | |
| 64 gfx::AcceleratedWidget w) { | |
| 65 if (delegate_) { | |
| 66 return delegate_->AcceleratedWidgetCanBeResized(w); | |
| 67 } else { | |
| 68 return false; | |
| 69 } | |
| 70 } | |
| 71 | |
| 72 } // namespace ui | |
| OLD | NEW |