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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.h

Issue 9194005: gpu: reference target surfaces through a globally unique surface id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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
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_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
7 #pragma once 7 #pragma once
8 8
9 #if defined(ENABLE_GPU) 9 #if defined(ENABLE_GPU)
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 GpuCommandBufferStub( 42 GpuCommandBufferStub(
43 GpuChannel* channel, 43 GpuChannel* channel,
44 GpuCommandBufferStub* share_group, 44 GpuCommandBufferStub* share_group,
45 gfx::PluginWindowHandle handle, 45 gfx::PluginWindowHandle handle,
46 const gfx::Size& size, 46 const gfx::Size& size,
47 const gpu::gles2::DisallowedFeatures& disallowed_features, 47 const gpu::gles2::DisallowedFeatures& disallowed_features,
48 const std::string& allowed_extensions, 48 const std::string& allowed_extensions,
49 const std::vector<int32>& attribs, 49 const std::vector<int32>& attribs,
50 gfx::GpuPreference gpu_preference, 50 gfx::GpuPreference gpu_preference,
51 int32 route_id, 51 int32 route_id,
52 int32 client_id, 52 int32 surface_id,
53 int32 render_view_id,
54 GpuWatchdog* watchdog, 53 GpuWatchdog* watchdog,
55 bool software); 54 bool software);
56 55
57 virtual ~GpuCommandBufferStub(); 56 virtual ~GpuCommandBufferStub();
58 57
59 // IPC::Channel::Listener implementation: 58 // IPC::Channel::Listener implementation:
60 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 59 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
61 60
62 // IPC::Message::Sender implementation: 61 // IPC::Message::Sender implementation:
63 virtual bool Send(IPC::Message* msg) OVERRIDE; 62 virtual bool Send(IPC::Message* msg) OVERRIDE;
64 63
65 // Whether this command buffer can currently handle IPC messages. 64 // Whether this command buffer can currently handle IPC messages.
66 bool IsScheduled(); 65 bool IsScheduled();
67 66
68 // Whether this command buffer needs to be polled again in the future. 67 // Whether this command buffer needs to be polled again in the future.
69 bool HasMoreWork(); 68 bool HasMoreWork();
70 69
71 // Set the swap interval according to the command line. 70 // Set the swap interval according to the command line.
72 void SetSwapInterval(); 71 void SetSwapInterval();
73 72
74 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } 73 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); }
75 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } 74 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); }
76 75
77 // Identifies the renderer process. 76 // Identifies the target surface.
78 int32 client_id() const { return client_id_; } 77 int32 surface_id() const { return surface_id_; }
79
80 // Identifies a particular renderer belonging to the same renderer process.
81 int32 render_view_id() const { return render_view_id_; }
82 78
83 // Identifies the various GpuCommandBufferStubs in the GPU process belonging 79 // Identifies the various GpuCommandBufferStubs in the GPU process belonging
84 // to the same renderer process. 80 // to the same renderer process.
85 int32 route_id() const { return route_id_; } 81 int32 route_id() const { return route_id_; }
86 82
87 gfx::GpuPreference gpu_preference() { return gpu_preference_; } 83 gfx::GpuPreference gpu_preference() { return gpu_preference_; }
88 84
89 // Sends a message to the console. 85 // Sends a message to the console.
90 void SendConsoleMessage(int32 id, const std::string& message); 86 void SendConsoleMessage(int32 id, const std::string& message);
91 87
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 gfx::PluginWindowHandle handle_; 135 gfx::PluginWindowHandle handle_;
140 gfx::Size initial_size_; 136 gfx::Size initial_size_;
141 gpu::gles2::DisallowedFeatures disallowed_features_; 137 gpu::gles2::DisallowedFeatures disallowed_features_;
142 std::string allowed_extensions_; 138 std::string allowed_extensions_;
143 std::vector<int32> requested_attribs_; 139 std::vector<int32> requested_attribs_;
144 gfx::GpuPreference gpu_preference_; 140 gfx::GpuPreference gpu_preference_;
145 int32 route_id_; 141 int32 route_id_;
146 bool software_; 142 bool software_;
147 uint32 last_flush_count_; 143 uint32 last_flush_count_;
148 144
149 // The following two fields are used on Mac OS X to identify the window 145 // The following two fields is used to identify the window for the rendering
jonathan.backer 2012/01/16 19:47:26 s/two fields/field
piman 2012/01/17 19:40:54 Done. I simplified the comment a bit (because we o
150 // for the rendering results on the browser side. 146 // results on the browser side.
151 int32 client_id_; 147 int32 surface_id_;
152 int32 render_view_id_;
153 148
154 scoped_ptr<gpu::CommandBufferService> command_buffer_; 149 scoped_ptr<gpu::CommandBufferService> command_buffer_;
155 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; 150 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_;
156 scoped_ptr<gpu::GpuScheduler> scheduler_; 151 scoped_ptr<gpu::GpuScheduler> scheduler_;
157 scoped_refptr<gfx::GLContext> context_; 152 scoped_refptr<gfx::GLContext> context_;
158 scoped_refptr<gfx::GLSurface> surface_; 153 scoped_refptr<gfx::GLSurface> surface_;
159 154
160 // SetParent may be called before Initialize, in which case we need to keep 155 // SetParent may be called before Initialize, in which case we need to keep
161 // around the parent stub, so that Initialize can set the parent correctly. 156 // around the parent stub, so that Initialize can set the parent correctly.
162 base::WeakPtr<GpuCommandBufferStub> parent_stub_for_initialization_; 157 base::WeakPtr<GpuCommandBufferStub> parent_stub_for_initialization_;
163 uint32 parent_texture_for_initialization_; 158 uint32 parent_texture_for_initialization_;
164 159
165 GpuWatchdog* watchdog_; 160 GpuWatchdog* watchdog_;
166 161
167 // Zero or more video decoders owned by this stub, keyed by their 162 // Zero or more video decoders owned by this stub, keyed by their
168 // decoder_route_id. 163 // decoder_route_id.
169 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; 164 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_;
170 165
171 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); 166 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
172 }; 167 };
173 168
174 #endif // defined(ENABLE_GPU) 169 #endif // defined(ENABLE_GPU)
175 170
176 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 171 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698