| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/output_surface.h" | 5 #include "cc/output/output_surface.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 gfx::Size OutputSurface::SurfaceSize() const { | 216 gfx::Size OutputSurface::SurfaceSize() const { |
| 217 return surface_size_; | 217 return surface_size_; |
| 218 } | 218 } |
| 219 | 219 |
| 220 void OutputSurface::BindFramebuffer() { | 220 void OutputSurface::BindFramebuffer() { |
| 221 DCHECK(context_provider_.get()); | 221 DCHECK(context_provider_.get()); |
| 222 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 222 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void OutputSurface::SwapBuffers(CompositorFrame* frame) { | 225 void OutputSurface::SwapBuffers(CompositorFrame* frame) { |
| 226 // TODO(sievers): Make OutputSurface::SwapBuffers() pure virtual. |
| 227 // The implementation here is used for tests only. |
| 226 if (frame->software_frame_data) { | 228 if (frame->software_frame_data) { |
| 227 PostSwapBuffersComplete(); | 229 PostSwapBuffersComplete(); |
| 228 client_->DidSwapBuffers(); | 230 client_->DidSwapBuffers(); |
| 229 return; | 231 return; |
| 230 } | 232 } |
| 231 | 233 |
| 232 DCHECK(context_provider_.get()); | 234 DCHECK(context_provider_.get()); |
| 233 DCHECK(frame->gl_frame_data); | 235 DCHECK(frame->gl_frame_data); |
| 234 | 236 |
| 235 if (frame->gl_frame_data->sub_buffer_rect == | 237 if (frame->gl_frame_data->sub_buffer_rect == |
| (...skipping 30 matching lines...) Expand all Loading... |
| 266 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 268 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
| 267 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 269 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
| 268 // Just ignore the memory manager when it says to set the limit to zero | 270 // Just ignore the memory manager when it says to set the limit to zero |
| 269 // bytes. This will happen when the memory manager thinks that the renderer | 271 // bytes. This will happen when the memory manager thinks that the renderer |
| 270 // is not visible (which the renderer knows better). | 272 // is not visible (which the renderer knows better). |
| 271 if (policy.bytes_limit_when_visible) | 273 if (policy.bytes_limit_when_visible) |
| 272 client_->SetMemoryPolicy(policy); | 274 client_->SetMemoryPolicy(policy); |
| 273 } | 275 } |
| 274 | 276 |
| 275 } // namespace cc | 277 } // namespace cc |
| OLD | NEW |