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

Side by Side Diff: content/common/gpu/gpu_channel.cc

Issue 383303004: Added more detailed result codes for CreateViewCommandBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Deleted commented-out code from test. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 if (preempting_flag_.get()) { 545 if (preempting_flag_.get()) {
546 io_message_loop_->PostTask( 546 io_message_loop_->PostTask(
547 FROM_HERE, 547 FROM_HERE,
548 base::Bind(&GpuChannelMessageFilter::UpdateStubSchedulingState, 548 base::Bind(&GpuChannelMessageFilter::UpdateStubSchedulingState,
549 filter_, 549 filter_,
550 a_stub_is_descheduled)); 550 a_stub_is_descheduled));
551 } 551 }
552 } 552 }
553 } 553 }
554 554
555 bool GpuChannel::CreateViewCommandBuffer( 555 CreateCommandBufferResult GpuChannel::CreateViewCommandBuffer(
556 const gfx::GLSurfaceHandle& window, 556 const gfx::GLSurfaceHandle& window,
557 int32 surface_id, 557 int32 surface_id,
558 const GPUCreateCommandBufferConfig& init_params, 558 const GPUCreateCommandBufferConfig& init_params,
559 int32 route_id) { 559 int32 route_id) {
560 TRACE_EVENT1("gpu", 560 TRACE_EVENT1("gpu",
561 "GpuChannel::CreateViewCommandBuffer", 561 "GpuChannel::CreateViewCommandBuffer",
562 "surface_id", 562 "surface_id",
563 surface_id); 563 surface_id);
564 564
565 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); 565 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id);
(...skipping 20 matching lines...) Expand all
586 route_id, 586 route_id,
587 surface_id, 587 surface_id,
588 watchdog_, 588 watchdog_,
589 software_, 589 software_,
590 init_params.active_url)); 590 init_params.active_url));
591 if (preempted_flag_.get()) 591 if (preempted_flag_.get())
592 stub->SetPreemptByFlag(preempted_flag_); 592 stub->SetPreemptByFlag(preempted_flag_);
593 if (!router_.AddRoute(route_id, stub.get())) { 593 if (!router_.AddRoute(route_id, stub.get())) {
594 DLOG(ERROR) << "GpuChannel::CreateViewCommandBuffer(): " 594 DLOG(ERROR) << "GpuChannel::CreateViewCommandBuffer(): "
595 "failed to add route"; 595 "failed to add route";
596 return false; 596 return CREATE_COMMAND_BUFFER_FAILED_AND_CHANNEL_LOST;
597 } 597 }
598 stubs_.AddWithID(stub.release(), route_id); 598 stubs_.AddWithID(stub.release(), route_id);
599 return true; 599 return CREATE_COMMAND_BUFFER_SUCCEEDED;
600 } 600 }
601 601
602 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { 602 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) {
603 return stubs_.Lookup(route_id); 603 return stubs_.Lookup(route_id);
604 } 604 }
605 605
606 void GpuChannel::CreateImage( 606 void GpuChannel::CreateImage(
607 gfx::PluginWindowHandle window, 607 gfx::PluginWindowHandle window,
608 int32 image_id, 608 int32 image_id,
609 gfx::Size* size) { 609 gfx::Size* size) {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 uint64 GpuChannel::GetMemoryUsage() { 861 uint64 GpuChannel::GetMemoryUsage() {
862 uint64 size = 0; 862 uint64 size = 0;
863 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); 863 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_);
864 !it.IsAtEnd(); it.Advance()) { 864 !it.IsAtEnd(); it.Advance()) {
865 size += it.GetCurrentValue()->GetMemoryUsage(); 865 size += it.GetCurrentValue()->GetMemoryUsage();
866 } 866 }
867 return size; 867 return size;
868 } 868 }
869 869
870 } // namespace content 870 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698