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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 | 10 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 | 397 |
398 channel_id_ = IPC::Channel::GenerateVerifiedChannelID("gpu"); | 398 channel_id_ = IPC::Channel::GenerateVerifiedChannelID("gpu"); |
399 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 399 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
400 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); | 400 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); |
401 } | 401 } |
402 | 402 |
403 GpuChannel::~GpuChannel() { | 403 GpuChannel::~GpuChannel() { |
404 STLDeleteElements(&deferred_messages_); | 404 STLDeleteElements(&deferred_messages_); |
405 if (preempting_flag_.get()) | 405 if (preempting_flag_.get()) |
406 preempting_flag_->Reset(); | 406 preempting_flag_->Reset(); |
407 | |
408 if (image_manager_) | |
409 image_manager_->Destroy(true); | |
reveman
2014/06/03 13:57:39
true? Do you always have a context current in this
sohanjg
2014/06/03 15:09:20
Done.
gpu channel was destroyed before cmd buffer
| |
407 } | 410 } |
408 | 411 |
409 void GpuChannel::Init(base::MessageLoopProxy* io_message_loop, | 412 void GpuChannel::Init(base::MessageLoopProxy* io_message_loop, |
410 base::WaitableEvent* shutdown_event) { | 413 base::WaitableEvent* shutdown_event) { |
411 DCHECK(!channel_.get()); | 414 DCHECK(!channel_.get()); |
412 | 415 |
413 // Map renderer ID to a (single) channel to that process. | 416 // Map renderer ID to a (single) channel to that process. |
414 channel_.reset(new IPC::SyncChannel( | 417 channel_.reset(new IPC::SyncChannel( |
415 channel_id_, | 418 channel_id_, |
416 IPC::Channel::MODE_SERVER, | 419 IPC::Channel::MODE_SERVER, |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 uint64 GpuChannel::GetMemoryUsage() { | 840 uint64 GpuChannel::GetMemoryUsage() { |
838 uint64 size = 0; | 841 uint64 size = 0; |
839 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); | 842 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); |
840 !it.IsAtEnd(); it.Advance()) { | 843 !it.IsAtEnd(); it.Advance()) { |
841 size += it.GetCurrentValue()->GetMemoryUsage(); | 844 size += it.GetCurrentValue()->GetMemoryUsage(); |
842 } | 845 } |
843 return size; | 846 return size; |
844 } | 847 } |
845 | 848 |
846 } // namespace content | 849 } // namespace content |
OLD | NEW |