| 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/software_renderer.h" | 5 #include "cc/output/software_renderer.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 TRACE_EVENT0("cc", "SoftwareRenderer::FinishDrawingFrame"); | 144 TRACE_EVENT0("cc", "SoftwareRenderer::FinishDrawingFrame"); |
| 145 current_framebuffer_lock_.reset(); | 145 current_framebuffer_lock_.reset(); |
| 146 current_canvas_ = NULL; | 146 current_canvas_ = NULL; |
| 147 root_canvas_ = NULL; | 147 root_canvas_ = NULL; |
| 148 | 148 |
| 149 current_frame_data_.reset(new SoftwareFrameData); | 149 current_frame_data_.reset(new SoftwareFrameData); |
| 150 output_device_->EndPaint(current_frame_data_.get()); | 150 output_device_->EndPaint(current_frame_data_.get()); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void SoftwareRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { | 153 void SoftwareRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { |
| 154 TRACE_EVENT0("cc,benchmark", "SoftwareRenderer::SwapBuffers"); |
| 154 CompositorFrame compositor_frame; | 155 CompositorFrame compositor_frame; |
| 155 compositor_frame.metadata = metadata; | 156 compositor_frame.metadata = metadata; |
| 156 compositor_frame.software_frame_data = current_frame_data_.Pass(); | 157 compositor_frame.software_frame_data = current_frame_data_.Pass(); |
| 157 output_surface_->SwapBuffers(&compositor_frame); | 158 output_surface_->SwapBuffers(&compositor_frame); |
| 158 } | 159 } |
| 159 | 160 |
| 160 void SoftwareRenderer::ReceiveSwapBuffersAck(const CompositorFrameAck& ack) { | 161 void SoftwareRenderer::ReceiveSwapBuffersAck(const CompositorFrameAck& ack) { |
| 161 output_device_->ReclaimSoftwareFrame(ack.last_software_frame_id); | 162 output_device_->ReclaimSoftwareFrame(ack.last_software_frame_id); |
| 162 } | 163 } |
| 163 | 164 |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 return; | 659 return; |
| 659 visible_ = visible; | 660 visible_ = visible; |
| 660 | 661 |
| 661 if (visible_) | 662 if (visible_) |
| 662 EnsureBackbuffer(); | 663 EnsureBackbuffer(); |
| 663 else | 664 else |
| 664 DiscardBackbuffer(); | 665 DiscardBackbuffer(); |
| 665 } | 666 } |
| 666 | 667 |
| 667 } // namespace cc | 668 } // namespace cc |
| OLD | NEW |