Home | History | Annotate | Download | only in public
      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/surface_ozone_canvas.h"
     11 #include "ui/ozone/public/surface_ozone_egl.h"
     12 
     13 namespace ui {
     14 
     15 // static
     16 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL;
     17 
     18 SurfaceFactoryOzone::SurfaceFactoryOzone() {
     19   CHECK(!impl_) << "There should only be a single SurfaceFactoryOzone.";
     20   impl_ = this;
     21 }
     22 
     23 SurfaceFactoryOzone::~SurfaceFactoryOzone() {
     24   CHECK_EQ(impl_, this);
     25   impl_ = NULL;
     26 }
     27 
     28 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() {
     29   CHECK(impl_) << "No SurfaceFactoryOzone implementation set.";
     30   return impl_;
     31 }
     32 
     33 intptr_t SurfaceFactoryOzone::GetNativeDisplay() {
     34   return 0;
     35 }
     36 
     37 scoped_ptr<SurfaceOzoneEGL> SurfaceFactoryOzone::CreateEGLSurfaceForWidget(
     38     gfx::AcceleratedWidget widget) {
     39   NOTIMPLEMENTED();
     40   return scoped_ptr<SurfaceOzoneEGL>();
     41 }
     42 
     43 scoped_ptr<SurfaceOzoneCanvas> SurfaceFactoryOzone::CreateCanvasForWidget(
     44     gfx::AcceleratedWidget widget) {
     45   NOTIMPLEMENTED();
     46   return scoped_ptr<SurfaceOzoneCanvas>();
     47 }
     48 
     49 const int32* SurfaceFactoryOzone::GetEGLSurfaceProperties(
     50     const int32* desired_attributes) {
     51   return desired_attributes;
     52 }
     53 
     54 ui::OverlayCandidatesOzone* SurfaceFactoryOzone::GetOverlayCandidates(
     55     gfx::AcceleratedWidget w) {
     56   return NULL;
     57 }
     58 
     59 void SurfaceFactoryOzone::ScheduleOverlayPlane(
     60     gfx::AcceleratedWidget w,
     61     int plane_z_order,
     62     gfx::OverlayTransform plane_transform,
     63     ui::NativeBufferOzone buffer,
     64     const gfx::Rect& display_bounds,
     65     gfx::RectF crop_rect) {
     66   NOTREACHED();
     67 }
     68 
     69 ui::NativeBufferOzone SurfaceFactoryOzone::CreateNativeBuffer(
     70     gfx::Size size,
     71     BufferFormat format) {
     72   return 0;
     73 }
     74 
     75 }  // namespace ui
     76