OLD | NEW |
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 | 16 // static |
17 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL; | 17 SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL; |
18 | 18 |
19 SurfaceFactoryOzone::SurfaceFactoryOzone() { | 19 SurfaceFactoryOzone::SurfaceFactoryOzone() { |
20 DCHECK(!impl_) << "There should only be a single SurfaceFactoryOzone."; | 20 DCHECK(!impl_) << "There should only be a single SurfaceFactoryOzone."; |
21 impl_ = this; | 21 impl_ = this; |
22 } | 22 } |
23 | 23 |
24 SurfaceFactoryOzone::~SurfaceFactoryOzone() { | 24 SurfaceFactoryOzone::~SurfaceFactoryOzone() { |
| 25 DCHECK(thread_checker_.CalledOnValidThread()); |
25 DCHECK_EQ(impl_, this); | 26 DCHECK_EQ(impl_, this); |
26 impl_ = NULL; | 27 impl_ = nullptr; |
27 } | 28 } |
28 | 29 |
29 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() { | 30 SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() { |
30 DCHECK(impl_) << "No SurfaceFactoryOzone implementation set."; | 31 DCHECK(impl_) << "No SurfaceFactoryOzone implementation set."; |
| 32 DCHECK(impl_->thread_checker_.CalledOnValidThread()); |
31 return impl_; | 33 return impl_; |
32 } | 34 } |
33 | 35 |
34 intptr_t SurfaceFactoryOzone::GetNativeDisplay() { | 36 intptr_t SurfaceFactoryOzone::GetNativeDisplay() { |
35 return 0; | 37 return 0; |
36 } | 38 } |
37 | 39 |
38 int SurfaceFactoryOzone::GetDrmFd() { | 40 int SurfaceFactoryOzone::GetDrmFd() { |
39 return -1; | 41 return -1; |
40 } | 42 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 90 |
89 bool SurfaceFactoryOzone::CanShowPrimaryPlaneAsOverlay() { | 91 bool SurfaceFactoryOzone::CanShowPrimaryPlaneAsOverlay() { |
90 return false; | 92 return false; |
91 } | 93 } |
92 | 94 |
93 bool SurfaceFactoryOzone::CanCreateNativePixmap(BufferUsage usage) { | 95 bool SurfaceFactoryOzone::CanCreateNativePixmap(BufferUsage usage) { |
94 return false; | 96 return false; |
95 } | 97 } |
96 | 98 |
97 } // namespace ui | 99 } // namespace ui |
OLD | NEW |