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

Side by Side Diff: ui/ozone/gpu/gpu_platform_support.cc

Issue 338193003: ozone: gpu: Add plumbing for platform-specific gpu messaging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
(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 int32 route_id) OVERRIDE {}
22 bool OnMessageReceived(const IPC::Message&) OVERRIDE { return false; }
23 };
24
25 } // namespace
26
27 // static
28 GpuPlatformSupport* GpuPlatformSupport::Initialize() {
29 TRACE_EVENT0("ozone", "GpuPlatformSupport::Initialize");
30
31 CHECK(!instance_);
piman 2014/06/16 23:53:14 DCHECK instead
32 scoped_ptr<GpuPlatformSupport> gpu_platform_support =
33 PlatformObject<GpuPlatformSupport>::Create();
34 instance_ = gpu_platform_support.release();
35 return instance_;
36 }
37
38 // static
39 GpuPlatformSupport* GpuPlatformSupport::GetInstance() {
40 return instance_;
41 }
42
43 // static
44 GpuPlatformSupport* GpuPlatformSupport::instance_;
45
46 GpuPlatformSupport* CreateStubGpuPlatformSupport() {
47 return new StubGpuPlatformSupport;
48 }
49
50 // TODO(spang): Stubs for internal platforms
51 OZONE_GPU_EXPORT GpuPlatformSupport* CreateGpuPlatformSupportCaca() {
52 return new StubGpuPlatformSupport;
53 }
54 OZONE_GPU_EXPORT GpuPlatformSupport* CreateGpuPlatformSupportDri() {
55 return new StubGpuPlatformSupport;
56 }
57 OZONE_GPU_EXPORT GpuPlatformSupport* CreateGpuPlatformSupportEgltest() {
58 return new StubGpuPlatformSupport;
59 }
60 OZONE_GPU_EXPORT GpuPlatformSupport* CreateGpuPlatformSupportGbm() {
61 return new StubGpuPlatformSupport;
62 }
63 OZONE_GPU_EXPORT GpuPlatformSupport* CreateGpuPlatformSupportTest() {
64 return new StubGpuPlatformSupport;
65 }
66
67 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698