OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "cc/output/delegating_renderer.h" | 5 #include "cc/output/delegating_renderer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 void DelegatingRenderer::ReceiveSwapBuffersAck( | 143 void DelegatingRenderer::ReceiveSwapBuffersAck( |
144 const CompositorFrameAck& ack) { | 144 const CompositorFrameAck& ack) { |
145 resource_provider_->ReceiveReturnsFromParent(ack.resources); | 145 resource_provider_->ReceiveReturnsFromParent(ack.resources); |
146 } | 146 } |
147 | 147 |
148 bool DelegatingRenderer::IsContextLost() { | 148 bool DelegatingRenderer::IsContextLost() { |
149 ContextProvider* context_provider = output_surface_->context_provider(); | 149 ContextProvider* context_provider = output_surface_->context_provider(); |
150 if (!context_provider) | 150 if (!context_provider) |
151 return false; | 151 return false; |
152 return context_provider->Context3d()->getGraphicsResetStatusARB() != | 152 return context_provider->IsContextLost(); |
153 GL_NO_ERROR; | |
154 } | 153 } |
155 | 154 |
156 void DelegatingRenderer::SetVisible(bool visible) { | 155 void DelegatingRenderer::SetVisible(bool visible) { |
157 if (visible == visible_) | 156 if (visible == visible_) |
158 return; | 157 return; |
159 | 158 |
160 visible_ = visible; | 159 visible_ = visible; |
161 ContextProvider* context_provider = output_surface_->context_provider(); | 160 ContextProvider* context_provider = output_surface_->context_provider(); |
162 if (!visible_) { | 161 if (!visible_) { |
163 TRACE_EVENT0("cc", "DelegatingRenderer::SetVisible dropping resources"); | 162 TRACE_EVENT0("cc", "DelegatingRenderer::SetVisible dropping resources"); |
(...skipping 22 matching lines...) Expand all Loading... |
186 gpu::ManagedMemoryStats stats; | 185 gpu::ManagedMemoryStats stats; |
187 stats.bytes_required = bytes_visible; | 186 stats.bytes_required = bytes_visible; |
188 stats.bytes_nice_to_have = bytes_visible_and_nearby; | 187 stats.bytes_nice_to_have = bytes_visible_and_nearby; |
189 stats.bytes_allocated = bytes_allocated; | 188 stats.bytes_allocated = bytes_allocated; |
190 stats.backbuffer_requested = false; | 189 stats.backbuffer_requested = false; |
191 | 190 |
192 context_provider->ContextSupport()->SendManagedMemoryStats(stats); | 191 context_provider->ContextSupport()->SendManagedMemoryStats(stats); |
193 } | 192 } |
194 | 193 |
195 } // namespace cc | 194 } // namespace cc |
OLD | NEW |