| OLD | NEW |
| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 CreateGpuMemoryBufferCallbackMap create_gpu_memory_buffer_requests_; | 109 CreateGpuMemoryBufferCallbackMap create_gpu_memory_buffer_requests_; |
| 105 | 110 |
| 106 static BrowserGpuChannelHostFactory* instance_; | 111 static BrowserGpuChannelHostFactory* instance_; |
| 107 | 112 |
| 108 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); | 113 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); |
| 109 }; | 114 }; |
| 110 | 115 |
| 111 } // namespace content | 116 } // namespace content |
| 112 | 117 |
| 113 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 118 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
| OLD | NEW |