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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 } | 616 } |
617 | 617 |
618 void GpuCommandBufferStub::SetMemoryAllocation( | 618 void GpuCommandBufferStub::SetMemoryAllocation( |
619 const GpuMemoryAllocation& allocation) { | 619 const GpuMemoryAllocation& allocation) { |
620 if (allocation == allocation_) | 620 if (allocation == allocation_) |
621 return; | 621 return; |
622 allocation_ = allocation; | 622 allocation_ = allocation; |
623 | 623 |
624 SendMemoryAllocationToProxy(allocation); | 624 SendMemoryAllocationToProxy(allocation); |
625 | 625 |
| 626 DCHECK(surface_); |
| 627 |
626 if (!surface_) | 628 if (!surface_) |
627 return; | 629 return; |
628 if (allocation.has_frontbuffer && allocation.has_backbuffer) | 630 if (allocation.suggest_have_frontbuffer && allocation.suggest_have_backbuffer) |
629 surface_->SetBufferAllocation( | 631 surface_->SetBufferAllocation( |
630 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); | 632 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); |
631 else if (allocation.has_frontbuffer) | 633 else if (allocation.suggest_have_frontbuffer) |
632 surface_->SetBufferAllocation( | 634 surface_->SetBufferAllocation( |
633 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY); | 635 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY); |
634 else | 636 else |
635 surface_->SetBufferAllocation( | 637 surface_->SetBufferAllocation( |
636 gfx::GLSurface::BUFFER_ALLOCATION_NONE); | 638 gfx::GLSurface::BUFFER_ALLOCATION_NONE); |
637 } | 639 } |
638 | 640 |
639 #endif // defined(ENABLE_GPU) | 641 #endif // defined(ENABLE_GPU) |
OLD | NEW |