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

Side by Side Diff: content/browser/gpu/browser_gpu_channel_host_factory.h

Issue 699073004: content: Add command line flag for native GPU memory buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gpu-memory-buffer-impl-unittests
Patch Set: fix unit test failures on macosx Created 6 years 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 5 #ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "content/common/gpu/client/gpu_channel_host.h" 13 #include "content/common/gpu/client/gpu_channel_host.h"
14 #include "content/common/gpu/client/gpu_memory_buffer_factory_host.h" 14 #include "content/common/gpu/client/gpu_memory_buffer_factory_host.h"
15 #include "ipc/message_filter.h" 15 #include "ipc/message_filter.h"
16 16
17 namespace content { 17 namespace content {
18 class BrowserGpuMemoryBufferManager; 18 class BrowserGpuMemoryBufferManager;
19 19
20 class CONTENT_EXPORT BrowserGpuChannelHostFactory 20 class CONTENT_EXPORT BrowserGpuChannelHostFactory
21 : public GpuChannelHostFactory, 21 : public GpuChannelHostFactory,
22 public GpuMemoryBufferFactoryHost { 22 public GpuMemoryBufferFactoryHost {
23 public: 23 public:
24 static void Initialize(bool establish_gpu_channel); 24 static void Initialize(bool establish_gpu_channel);
25 static void Terminate(); 25 static void Terminate();
26 static BrowserGpuChannelHostFactory* instance() { return instance_; } 26 static BrowserGpuChannelHostFactory* instance() { return instance_; }
27 27
28 static void EnableGpuMemoryBufferFactoryUsage(
29 gfx::GpuMemoryBuffer::Usage usage);
30 static bool IsGpuMemoryBufferFactoryUsageEnabled(
31 gfx::GpuMemoryBuffer::Usage usage);
32
28 // Overridden from GpuChannelHostFactory: 33 // Overridden from GpuChannelHostFactory:
29 bool IsMainThread() override; 34 bool IsMainThread() override;
30 base::MessageLoop* GetMainLoop() override; 35 base::MessageLoop* GetMainLoop() override;
31 scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() override; 36 scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() override;
32 scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) override; 37 scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) override;
33 CreateCommandBufferResult CreateViewCommandBuffer( 38 CreateCommandBufferResult CreateViewCommandBuffer(
34 int32 surface_id, 39 int32 surface_id,
35 const GPUCreateCommandBufferConfig& init_params, 40 const GPUCreateCommandBufferConfig& init_params,
36 int32 route_id) override; 41 int32 route_id) override;
37 42
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 CreateGpuMemoryBufferCallbackMap create_gpu_memory_buffer_requests_; 111 CreateGpuMemoryBufferCallbackMap create_gpu_memory_buffer_requests_;
107 112
108 static BrowserGpuChannelHostFactory* instance_; 113 static BrowserGpuChannelHostFactory* instance_;
109 114
110 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); 115 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory);
111 }; 116 };
112 117
113 } // namespace content 118 } // namespace content
114 119
115 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 120 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698