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

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

Issue 1129943006: Implement StreamTexture::BindTexImage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CreateStreamTexture Flow Change. Created 5 years, 5 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
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
(...skipping 13 matching lines...) Expand all
24 static BrowserGpuChannelHostFactory* instance() { return instance_; } 24 static BrowserGpuChannelHostFactory* instance() { return instance_; }
25 25
26 // Overridden from GpuChannelHostFactory: 26 // Overridden from GpuChannelHostFactory:
27 bool IsMainThread() override; 27 bool IsMainThread() override;
28 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; 28 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
29 scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) override; 29 scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) override;
30 CreateCommandBufferResult CreateViewCommandBuffer( 30 CreateCommandBufferResult CreateViewCommandBuffer(
31 int32 surface_id, 31 int32 surface_id,
32 const GPUCreateCommandBufferConfig& init_params, 32 const GPUCreateCommandBufferConfig& init_params,
33 int32 route_id) override; 33 int32 route_id) override;
34 bool CreateStreamTexture(int32 image_id,
35 int32 route_id,
36 int32 stream_id) override;
34 IPC::AttachmentBroker* GetAttachmentBroker() override; 37 IPC::AttachmentBroker* GetAttachmentBroker() override;
35 38
36 int GpuProcessHostId() { return gpu_host_id_; } 39 int GpuProcessHostId() { return gpu_host_id_; }
37 #if !defined(OS_ANDROID) 40 #if !defined(OS_ANDROID)
38 GpuChannelHost* EstablishGpuChannelSync( 41 GpuChannelHost* EstablishGpuChannelSync(
39 CauseForGpuLaunch cause_for_gpu_launch); 42 CauseForGpuLaunch cause_for_gpu_launch);
40 #endif 43 #endif
41 void EstablishGpuChannel(CauseForGpuLaunch cause_for_gpu_launch, 44 void EstablishGpuChannel(CauseForGpuLaunch cause_for_gpu_launch,
42 const base::Closure& callback); 45 const base::Closure& callback);
43 GpuChannelHost* GetGpuChannel(); 46 GpuChannelHost* GetGpuChannel();
44 int GetGpuChannelId() { return gpu_client_id_; } 47 int GetGpuChannelId() { return gpu_client_id_; }
45 48
46 // Used to skip GpuChannelHost tests when there can be no GPU process. 49 // Used to skip GpuChannelHost tests when there can be no GPU process.
47 static bool CanUseForTesting(); 50 static bool CanUseForTesting();
48 51
49 private: 52 private:
50 struct CreateRequest; 53 struct CreateRequest;
54 struct CreateStreamTextureRequest;
51 class EstablishRequest; 55 class EstablishRequest;
52 56
53 BrowserGpuChannelHostFactory(); 57 BrowserGpuChannelHostFactory();
54 ~BrowserGpuChannelHostFactory() override; 58 ~BrowserGpuChannelHostFactory() override;
55 59
56 void GpuChannelEstablished(); 60 void GpuChannelEstablished();
57 void CreateViewCommandBufferOnIO( 61 void CreateViewCommandBufferOnIO(
58 CreateRequest* request, 62 CreateRequest* request,
59 int32 surface_id, 63 int32 surface_id,
60 const GPUCreateCommandBufferConfig& init_params); 64 const GPUCreateCommandBufferConfig& init_params);
65
reveman 2015/06/29 16:02:00 why blank line here but not below?
sivag 2015/06/30 11:17:17 Done.
66 void CreateStreamTextureOnIO(CreateStreamTextureRequest* request);
67
61 static void CommandBufferCreatedOnIO(CreateRequest* request, 68 static void CommandBufferCreatedOnIO(CreateRequest* request,
62 CreateCommandBufferResult result); 69 CreateCommandBufferResult result);
70 static void StreamTextureCreatedOnIO(CreateStreamTextureRequest* request,
71 bool result);
63 static void AddFilterOnIO(int gpu_host_id, 72 static void AddFilterOnIO(int gpu_host_id,
64 scoped_refptr<IPC::MessageFilter> filter); 73 scoped_refptr<IPC::MessageFilter> filter);
65 74
66 const int gpu_client_id_; 75 const int gpu_client_id_;
67 scoped_ptr<base::WaitableEvent> shutdown_event_; 76 scoped_ptr<base::WaitableEvent> shutdown_event_;
68 scoped_refptr<GpuChannelHost> gpu_channel_; 77 scoped_refptr<GpuChannelHost> gpu_channel_;
69 scoped_ptr<BrowserGpuMemoryBufferManager> gpu_memory_buffer_manager_; 78 scoped_ptr<BrowserGpuMemoryBufferManager> gpu_memory_buffer_manager_;
70 int gpu_host_id_; 79 int gpu_host_id_;
71 scoped_refptr<EstablishRequest> pending_request_; 80 scoped_refptr<EstablishRequest> pending_request_;
72 std::vector<base::Closure> established_callbacks_; 81 std::vector<base::Closure> established_callbacks_;
73 82
74 static BrowserGpuChannelHostFactory* instance_; 83 static BrowserGpuChannelHostFactory* instance_;
75 84
76 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); 85 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory);
77 }; 86 };
78 87
79 } // namespace content 88 } // namespace content
80 89
81 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 90 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/gpu/browser_gpu_channel_host_factory.cc » ('j') | content/common/gpu/gpu_messages.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698