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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 void DelegatingRenderer::ReceiveSwapBuffersAck( | 103 void DelegatingRenderer::ReceiveSwapBuffersAck( |
104 const CompositorFrameAck& ack) { | 104 const CompositorFrameAck& ack) { |
105 resource_provider_->ReceiveReturnsFromParent(ack.resources); | 105 resource_provider_->ReceiveReturnsFromParent(ack.resources); |
106 } | 106 } |
107 | 107 |
108 void DelegatingRenderer::DidChangeVisibility() { | 108 void DelegatingRenderer::DidChangeVisibility() { |
109 ContextProvider* context_provider = output_surface_->context_provider(); | 109 ContextProvider* context_provider = output_surface_->context_provider(); |
110 if (!visible()) { | 110 if (!visible()) { |
111 TRACE_EVENT0("cc", "DelegatingRenderer::SetVisible dropping resources"); | 111 TRACE_EVENT0("cc", "DelegatingRenderer::SetVisible dropping resources"); |
112 resource_provider_->ReleaseCachedData(); | |
113 if (context_provider) { | 112 if (context_provider) { |
114 context_provider->DeleteCachedResources(); | 113 context_provider->DeleteCachedResources(); |
115 context_provider->ContextGL()->Flush(); | 114 context_provider->ContextGL()->Flush(); |
116 } | 115 } |
117 } | 116 } |
118 // We loop visibility to the GPU process, since that's what manages memory. | 117 // We loop visibility to the GPU process, since that's what manages memory. |
119 // That will allow it to feed us with memory allocations that we can act | 118 // That will allow it to feed us with memory allocations that we can act |
120 // upon. | 119 // upon. |
121 if (context_provider) | 120 if (context_provider) |
122 context_provider->ContextSupport()->SetSurfaceVisible(visible()); | 121 context_provider->ContextSupport()->SetSurfaceVisible(visible()); |
123 } | 122 } |
124 | 123 |
125 } // namespace cc | 124 } // namespace cc |
OLD | NEW |