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.
5 #include "ui/gfx/ozone/surface_factory_ozone.h"
12 SurfaceFactoryOzone
* SurfaceFactoryOzone::impl_
= NULL
;
14 class SurfaceFactoryOzoneStub
: public SurfaceFactoryOzone
{
16 SurfaceFactoryOzoneStub() {}
17 virtual ~SurfaceFactoryOzoneStub() {}
19 virtual HardwareState
InitializeHardware() OVERRIDE
{ return INITIALIZED
; }
20 virtual void ShutdownHardware() OVERRIDE
{}
21 virtual gfx::AcceleratedWidget
GetAcceleratedWidget() OVERRIDE
{ return 0; }
22 virtual gfx::AcceleratedWidget
RealizeAcceleratedWidget(
23 gfx::AcceleratedWidget w
) OVERRIDE
{
26 virtual bool LoadEGLGLES2Bindings() OVERRIDE
{ return true; }
27 virtual bool AttemptToResizeAcceleratedWidget(
28 gfx::AcceleratedWidget w
,
29 const gfx::Rect
& bounds
) OVERRIDE
{
32 virtual gfx::VSyncProvider
* GetVSyncProvider(
33 gfx::AcceleratedWidget w
) OVERRIDE
{
38 SurfaceFactoryOzone::SurfaceFactoryOzone() {
41 SurfaceFactoryOzone::~SurfaceFactoryOzone() {
44 SurfaceFactoryOzone
* SurfaceFactoryOzone::GetInstance() {
45 CHECK(impl_
) << "SurfaceFactoryOzone accessed before constructed";
49 void SurfaceFactoryOzone::SetInstance(SurfaceFactoryOzone
* impl
) {
53 const char* SurfaceFactoryOzone::DefaultDisplaySpec() {
54 char* envvar
= getenv("ASH_DISPLAY_SPEC");
60 gfx::Screen
* SurfaceFactoryOzone::CreateDesktopScreen() {
64 intptr_t SurfaceFactoryOzone::GetNativeDisplay() {
68 bool SurfaceFactoryOzone::SchedulePageFlip(gfx::AcceleratedWidget
) {
72 const int32
* SurfaceFactoryOzone::GetEGLSurfaceProperties(
73 const int32
* desired_attributes
) {
74 return desired_attributes
;
78 SurfaceFactoryOzone
* SurfaceFactoryOzone::CreateTestHelper() {
79 return new SurfaceFactoryOzoneStub
;