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(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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) { | 707 void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) { |
708 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetSurfaceVisible"); | 708 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetSurfaceVisible"); |
709 GetMemoryManager()-> | 709 GetMemoryManager()-> |
710 SetClientVisible(this, visible); | 710 SetClientVisible(this, visible); |
711 } | 711 } |
712 | 712 |
713 void GpuCommandBufferStub::OnDiscardBackbuffer() { | 713 void GpuCommandBufferStub::OnDiscardBackbuffer() { |
714 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDiscardBackbuffer"); | 714 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDiscardBackbuffer"); |
715 if (!surface_) | 715 if (!surface_) |
716 return; | 716 return; |
717 surface_->SetBackbufferAllocation(false); | 717 if (surface_->DeferDraws()) { |
| 718 DCHECK(!IsScheduled()); |
| 719 channel_->RequeueMessage(); |
| 720 } else { |
| 721 surface_->SetBackbufferAllocation(false); |
| 722 } |
718 } | 723 } |
719 | 724 |
720 void GpuCommandBufferStub::OnEnsureBackbuffer() { | 725 void GpuCommandBufferStub::OnEnsureBackbuffer() { |
721 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEnsureBackbuffer"); | 726 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEnsureBackbuffer"); |
722 if (!surface_) | 727 if (!surface_) |
723 return; | 728 return; |
724 surface_->SetBackbufferAllocation(true); | 729 if (surface_->DeferDraws()) { |
| 730 DCHECK(!IsScheduled()); |
| 731 channel_->RequeueMessage(); |
| 732 } else { |
| 733 surface_->SetBackbufferAllocation(true); |
| 734 } |
725 } | 735 } |
726 | 736 |
727 void GpuCommandBufferStub::AddSyncPoint(uint32 sync_point) { | 737 void GpuCommandBufferStub::AddSyncPoint(uint32 sync_point) { |
728 sync_points_.push_back(sync_point); | 738 sync_points_.push_back(sync_point); |
729 } | 739 } |
730 | 740 |
731 void GpuCommandBufferStub::OnRetireSyncPoint(uint32 sync_point) { | 741 void GpuCommandBufferStub::OnRetireSyncPoint(uint32 sync_point) { |
732 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point); | 742 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point); |
733 sync_points_.pop_front(); | 743 sync_points_.pop_front(); |
734 GpuChannelManager* manager = channel_->gpu_channel_manager(); | 744 GpuChannelManager* manager = channel_->gpu_channel_manager(); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 // made current before calling methods on the surface. | 859 // made current before calling methods on the surface. |
850 if (!surface_ || !MakeCurrent()) | 860 if (!surface_ || !MakeCurrent()) |
851 return; | 861 return; |
852 surface_->SetFrontbufferAllocation( | 862 surface_->SetFrontbufferAllocation( |
853 allocation.browser_allocation.suggest_have_frontbuffer); | 863 allocation.browser_allocation.suggest_have_frontbuffer); |
854 } | 864 } |
855 | 865 |
856 } // namespace content | 866 } // namespace content |
857 | 867 |
858 #endif // defined(ENABLE_GPU) | 868 #endif // defined(ENABLE_GPU) |
OLD | NEW |