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

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

Issue 301793003: During image destroy, delete textures only if we have a GL context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP - Avoid optional image manager creation/destroy in context group 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
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 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 // Associates a sync point to this stub. When the stub is destroyed, it will 138 // Associates a sync point to this stub. When the stub is destroyed, it will
139 // retire all sync points that haven't been previously retired. 139 // retire all sync points that haven't been previously retired.
140 void AddSyncPoint(uint32 sync_point); 140 void AddSyncPoint(uint32 sync_point);
141 141
142 void SetPreemptByFlag(scoped_refptr<gpu::PreemptionFlag> flag); 142 void SetPreemptByFlag(scoped_refptr<gpu::PreemptionFlag> flag);
143 143
144 void SetLatencyInfoCallback(const LatencyInfoCallback& callback); 144 void SetLatencyInfoCallback(const LatencyInfoCallback& callback);
145 145
146 void MarkContextLost(); 146 void MarkContextLost();
147 bool CheckContextLost();
147 148
148 uint64 GetMemoryUsage() const; 149 uint64 GetMemoryUsage() const;
149 150
150 private: 151 private:
151 GpuMemoryManager* GetMemoryManager() const; 152 GpuMemoryManager* GetMemoryManager() const;
152 bool MakeCurrent(); 153 bool MakeCurrent();
153 void Destroy(); 154 void Destroy();
154 155
155 // Cleans up and sends reply if OnInitialize failed. 156 // Cleans up and sends reply if OnInitialize failed.
156 void OnInitializeFailed(IPC::Message* reply_message); 157 void OnInitializeFailed(IPC::Message* reply_message);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 void PutChanged(); 220 void PutChanged();
220 221
221 // Poll the command buffer to execute work. 222 // Poll the command buffer to execute work.
222 void PollWork(); 223 void PollWork();
223 224
224 // Whether this command buffer needs to be polled again in the future. 225 // Whether this command buffer needs to be polled again in the future.
225 bool HasMoreWork(); 226 bool HasMoreWork();
226 227
227 void ScheduleDelayedWork(int64 delay); 228 void ScheduleDelayedWork(int64 delay);
228 229
229 bool CheckContextLost();
230 void CheckCompleteWaits(); 230 void CheckCompleteWaits();
231 231
232 // The lifetime of objects of this class is managed by a GpuChannel. The 232 // The lifetime of objects of this class is managed by a GpuChannel. The
233 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they 233 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they
234 // are destroyed. So a raw pointer is safe. 234 // are destroyed. So a raw pointer is safe.
235 GpuChannel* channel_; 235 GpuChannel* channel_;
236 236
237 // The group of contexts that share namespaces with this context. 237 // The group of contexts that share namespaces with this context.
238 scoped_refptr<gpu::gles2::ContextGroup> context_group_; 238 scoped_refptr<gpu::gles2::ContextGroup> context_group_;
239 239
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 size_t total_gpu_memory_; 282 size_t total_gpu_memory_;
283 scoped_ptr<WaitForCommandState> wait_for_token_; 283 scoped_ptr<WaitForCommandState> wait_for_token_;
284 scoped_ptr<WaitForCommandState> wait_for_get_offset_; 284 scoped_ptr<WaitForCommandState> wait_for_get_offset_;
285 285
286 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); 286 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
287 }; 287 };
288 288
289 } // namespace content 289 } // namespace content
290 290
291 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 291 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698