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

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

Issue 9703024: Replacing GLSurface::SetVisibility with SetBufferAllocation for more explicit management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « no previous file | content/common/gpu/image_transport_surface_linux.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(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 channel_->renderer_process()); 557 channel_->renderer_process());
558 } 558 }
559 559
560 void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) { 560 void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) {
561 channel_->RemoveRoute(decoder_route_id); 561 channel_->RemoveRoute(decoder_route_id);
562 video_decoders_.Remove(decoder_route_id); 562 video_decoders_.Remove(decoder_route_id);
563 } 563 }
564 564
565 void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) { 565 void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) {
566 if (visible) 566 if (visible)
567 surface_->SetVisibility(gfx::GLSurface::VISIBILITY_STATE_FOREGROUND); 567 surface_->SetBufferAllocation(
568 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK);
568 DCHECK(surface_state_.get()); 569 DCHECK(surface_state_.get());
569 surface_state_->visible = visible; 570 surface_state_->visible = visible;
570 surface_state_->last_used_time = base::TimeTicks::Now(); 571 surface_state_->last_used_time = base::TimeTicks::Now();
571 channel_->gpu_channel_manager()->gpu_memory_manager()->ScheduleManage(); 572 channel_->gpu_channel_manager()->gpu_memory_manager()->ScheduleManage();
572 } 573 }
573 574
574 void GpuCommandBufferStub::SendConsoleMessage( 575 void GpuCommandBufferStub::SendConsoleMessage(
575 int32 id, 576 int32 id,
576 const std::string& message) { 577 const std::string& message) {
577 GPUCommandBufferConsoleMessage console_message; 578 GPUCommandBufferConsoleMessage console_message;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 const GpuMemoryAllocation& allocation) { 619 const GpuMemoryAllocation& allocation) {
619 if (allocation == allocation_) 620 if (allocation == allocation_)
620 return; 621 return;
621 allocation_ = allocation; 622 allocation_ = allocation;
622 623
623 SendMemoryAllocationToProxy(allocation); 624 SendMemoryAllocationToProxy(allocation);
624 625
625 if (!surface_) 626 if (!surface_)
626 return; 627 return;
627 if (allocation.has_frontbuffer && allocation.has_backbuffer) 628 if (allocation.has_frontbuffer && allocation.has_backbuffer)
628 surface_->SetVisibility(gfx::GLSurface::VISIBILITY_STATE_FOREGROUND); 629 surface_->SetBufferAllocation(
630 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK);
629 else if (allocation.has_frontbuffer) 631 else if (allocation.has_frontbuffer)
630 surface_->SetVisibility(gfx::GLSurface::VISIBILITY_STATE_BACKGROUND); 632 surface_->SetBufferAllocation(
633 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY);
631 else 634 else
632 surface_->SetVisibility(gfx::GLSurface::VISIBILITY_STATE_HIBERNATED); 635 surface_->SetBufferAllocation(
636 gfx::GLSurface::BUFFER_ALLOCATION_NONE);
633 } 637 }
634 638
635 #endif // defined(ENABLE_GPU) 639 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/image_transport_surface_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698