Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / ui / ozone / public / surface_factory_ozone.cc
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/ozone/public/surface_factory_ozone.h"
6
7 #include <stdlib.h>
8
9 #include "base/command_line.h"
10 #include "ui/ozone/public/native_pixmap.h"
11 #include "ui/ozone/public/surface_ozone_canvas.h"
12 #include "ui/ozone/public/surface_ozone_egl.h"
13
14 namespace ui {
15
16 // static
17 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL;
18
19 SurfaceFactoryOzone::SurfaceFactoryOzone() {
20   DCHECK(!impl_) << "There should only be a single SurfaceFactoryOzone.";
21   impl_ = this;
22 }
23
24 SurfaceFactoryOzone::~SurfaceFactoryOzone() {
25   DCHECK_EQ(impl_, this);
26   impl_ = NULL;
27 }
28
29 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() {
30   DCHECK(impl_) << "No SurfaceFactoryOzone implementation set.";
31   return impl_;
32 }
33
34 intptr_t SurfaceFactoryOzone::GetNativeDisplay() {
35   return 0;
36 }
37
38 scoped_ptr<SurfaceOzoneEGL> SurfaceFactoryOzone::CreateEGLSurfaceForWidget(
39     gfx::AcceleratedWidget widget) {
40   NOTIMPLEMENTED();
41   return scoped_ptr<SurfaceOzoneEGL>();
42 }
43
44 scoped_ptr<SurfaceOzoneCanvas> SurfaceFactoryOzone::CreateCanvasForWidget(
45     gfx::AcceleratedWidget widget) {
46   NOTIMPLEMENTED();
47   return scoped_ptr<SurfaceOzoneCanvas>();
48 }
49
50 const int32* SurfaceFactoryOzone::GetEGLSurfaceProperties(
51     const int32* desired_attributes) {
52   return desired_attributes;
53 }
54
55 ui::OverlayCandidatesOzone* SurfaceFactoryOzone::GetOverlayCandidates(
56     gfx::AcceleratedWidget w) {
57   return NULL;
58 }
59
60 scoped_refptr<ui::NativePixmap> SurfaceFactoryOzone::CreateNativePixmap(
61     gfx::Size size,
62     BufferFormat format) {
63   return NULL;
64 }
65
66 bool SurfaceFactoryOzone::ScheduleOverlayPlane(
67     gfx::AcceleratedWidget widget,
68     int plane_z_order,
69     gfx::OverlayTransform plane_transform,
70     scoped_refptr<NativePixmap> buffer,
71     const gfx::Rect& display_bounds,
72     const gfx::RectF& crop_rect) {
73   return false;
74 }
75
76 bool SurfaceFactoryOzone::CanShowPrimaryPlaneAsOverlay() {
77   return false;
78 }
79 }  // namespace ui