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

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

Issue 1171513002: Reland of Revert of ozone: Remove singleton pattern for SurfaceFactoryOzone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/public/surface_factory_ozone.h" 5 #include "ui/ozone/public/surface_factory_ozone.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "ui/ozone/public/native_pixmap.h" 10 #include "ui/ozone/public/native_pixmap.h"
11 #include "ui/ozone/public/surface_ozone_canvas.h" 11 #include "ui/ozone/public/surface_ozone_canvas.h"
12 #include "ui/ozone/public/surface_ozone_egl.h" 12 #include "ui/ozone/public/surface_ozone_egl.h"
13 13
14 namespace ui { 14 namespace ui {
15 15
16 // static
17 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL;
18
19 SurfaceFactoryOzone::SurfaceFactoryOzone() { 16 SurfaceFactoryOzone::SurfaceFactoryOzone() {
20 DCHECK(!impl_) << "There should only be a single SurfaceFactoryOzone.";
21 impl_ = this;
22 } 17 }
23 18
24 SurfaceFactoryOzone::~SurfaceFactoryOzone() { 19 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 } 20 }
33 21
34 intptr_t SurfaceFactoryOzone::GetNativeDisplay() { 22 intptr_t SurfaceFactoryOzone::GetNativeDisplay() {
35 return 0; 23 return 0;
36 } 24 }
37 25
38 scoped_ptr<SurfaceOzoneEGL> SurfaceFactoryOzone::CreateEGLSurfaceForWidget( 26 scoped_ptr<SurfaceOzoneEGL> SurfaceFactoryOzone::CreateEGLSurfaceForWidget(
39 gfx::AcceleratedWidget widget) { 27 gfx::AcceleratedWidget widget) {
40 NOTIMPLEMENTED(); 28 NOTIMPLEMENTED();
41 return nullptr; 29 return nullptr;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 67
80 bool SurfaceFactoryOzone::CanShowPrimaryPlaneAsOverlay() { 68 bool SurfaceFactoryOzone::CanShowPrimaryPlaneAsOverlay() {
81 return false; 69 return false;
82 } 70 }
83 71
84 bool SurfaceFactoryOzone::CanCreateNativePixmap(BufferUsage usage) { 72 bool SurfaceFactoryOzone::CanCreateNativePixmap(BufferUsage usage) {
85 return false; 73 return false;
86 } 74 }
87 75
88 } // namespace ui 76 } // namespace ui
OLDNEW
« ui/ozone/demo/software_renderer.cc ('K') | « ui/ozone/public/surface_factory_ozone.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698