OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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/gpu/gpu_platform_support.h" |
| 6 |
| 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" |
| 9 #include "ui/ozone/gpu/ozone_gpu_export.h" |
| 10 #include "ui/ozone/platform_object.h" |
| 11 |
| 12 namespace ui { |
| 13 |
| 14 namespace { |
| 15 |
| 16 // No-op implementation of GpuPlatformSupport. |
| 17 class OZONE_GPU_EXPORT StubGpuPlatformSupport : public GpuPlatformSupport { |
| 18 public: |
| 19 // GpuPlatformSupport: |
| 20 virtual void OnChannelEstablished(IPC::Sender* sender) {} |
| 21 bool OnMessageReceived(const IPC::Message&) OVERRIDE { return false; } |
| 22 }; |
| 23 |
| 24 } // namespace |
| 25 |
| 26 // static |
| 27 GpuPlatformSupport* GpuPlatformSupport::Initialize() { |
| 28 TRACE_EVENT0("ozone", "GpuPlatformSupport::Initialize"); |
| 29 |
| 30 DCHECK(!instance_); |
| 31 scoped_ptr<GpuPlatformSupport> gpu_platform_support = |
| 32 PlatformObject<GpuPlatformSupport>::Create(); |
| 33 instance_ = gpu_platform_support.release(); |
| 34 return instance_; |
| 35 } |
| 36 |
| 37 // static |
| 38 GpuPlatformSupport* GpuPlatformSupport::GetInstance() { |
| 39 return instance_; |
| 40 } |
| 41 |
| 42 // static |
| 43 GpuPlatformSupport* GpuPlatformSupport::instance_; |
| 44 |
| 45 GpuPlatformSupport* CreateStubGpuPlatformSupport() { |
| 46 return new StubGpuPlatformSupport; |
| 47 } |
| 48 |
| 49 // TODO(spang): Stubs for internal platforms |
| 50 OZONE_GPU_EXPORT GpuPlatformSupport* CreateGpuPlatformSupportCaca() { |
| 51 return new StubGpuPlatformSupport; |
| 52 } |
| 53 OZONE_GPU_EXPORT GpuPlatformSupport* CreateGpuPlatformSupportDri() { |
| 54 return new StubGpuPlatformSupport; |
| 55 } |
| 56 OZONE_GPU_EXPORT GpuPlatformSupport* CreateGpuPlatformSupportEgltest() { |
| 57 return new StubGpuPlatformSupport; |
| 58 } |
| 59 OZONE_GPU_EXPORT GpuPlatformSupport* CreateGpuPlatformSupportGbm() { |
| 60 return new StubGpuPlatformSupport; |
| 61 } |
| 62 OZONE_GPU_EXPORT GpuPlatformSupport* CreateGpuPlatformSupportTest() { |
| 63 return new StubGpuPlatformSupport; |
| 64 } |
| 65 |
| 66 } // namespace ui |
OLD | NEW |