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

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

Issue 27764002: Enable Ozone software implementation in GYP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactored GYP dridrm dependency Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gfx.gyp ('k') | ui/ui_unittests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/gfx/ozone/surface_factory_ozone.h" 5 #include "ui/gfx/ozone/surface_factory_ozone.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "ui/gfx/ozone/impl/software_surface_factory_ozone.h"
10
9 namespace gfx { 11 namespace gfx {
10 12
11 // static 13 // static
12 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL; 14 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL;
13 15
14 class SurfaceFactoryOzoneStub : public SurfaceFactoryOzone { 16 class SurfaceFactoryOzoneStub : public SurfaceFactoryOzone {
15 public: 17 public:
16 SurfaceFactoryOzoneStub() {} 18 SurfaceFactoryOzoneStub() {}
17 virtual ~SurfaceFactoryOzoneStub() {} 19 virtual ~SurfaceFactoryOzoneStub() {}
18 20
(...skipping 16 matching lines...) Expand all
35 } 37 }
36 }; 38 };
37 39
38 SurfaceFactoryOzone::SurfaceFactoryOzone() { 40 SurfaceFactoryOzone::SurfaceFactoryOzone() {
39 } 41 }
40 42
41 SurfaceFactoryOzone::~SurfaceFactoryOzone() { 43 SurfaceFactoryOzone::~SurfaceFactoryOzone() {
42 } 44 }
43 45
44 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() { 46 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() {
45 CHECK(impl_) << "SurfaceFactoryOzone accessed before constructed"; 47 if (!impl_) {
48 LOG(WARNING) << "No SurfaceFactoryOzone implementation set. Using default "
49 "gfx::SoftwareSurfaceFactoryOzone.";
50 impl_ = new SoftwareSurfaceFactoryOzone();
51 }
46 return impl_; 52 return impl_;
47 } 53 }
48 54
49 void SurfaceFactoryOzone::SetInstance(SurfaceFactoryOzone* impl) { 55 void SurfaceFactoryOzone::SetInstance(SurfaceFactoryOzone* impl) {
50 impl_ = impl; 56 impl_ = impl;
51 } 57 }
52 58
53 const char* SurfaceFactoryOzone::DefaultDisplaySpec() { 59 const char* SurfaceFactoryOzone::DefaultDisplaySpec() {
54 char* envvar = getenv("ASH_DISPLAY_SPEC"); 60 char* envvar = getenv("ASH_DISPLAY_SPEC");
55 if (envvar) 61 if (envvar)
(...skipping 17 matching lines...) Expand all
73 const int32* desired_attributes) { 79 const int32* desired_attributes) {
74 return desired_attributes; 80 return desired_attributes;
75 } 81 }
76 82
77 // static 83 // static
78 SurfaceFactoryOzone* SurfaceFactoryOzone::CreateTestHelper() { 84 SurfaceFactoryOzone* SurfaceFactoryOzone::CreateTestHelper() {
79 return new SurfaceFactoryOzoneStub; 85 return new SurfaceFactoryOzoneStub;
80 } 86 }
81 87
82 } // namespace gfx 88 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gfx.gyp ('k') | ui/ui_unittests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698