| 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 } | 639 } |
| 640 | 640 |
| 641 void SoftwareRenderer::EnsureBackbuffer() { | 641 void SoftwareRenderer::EnsureBackbuffer() { |
| 642 if (!is_backbuffer_discarded_) | 642 if (!is_backbuffer_discarded_) |
| 643 return; | 643 return; |
| 644 | 644 |
| 645 output_surface_->EnsureBackbuffer(); | 645 output_surface_->EnsureBackbuffer(); |
| 646 is_backbuffer_discarded_ = false; | 646 is_backbuffer_discarded_ = false; |
| 647 } | 647 } |
| 648 | 648 |
| 649 void SoftwareRenderer::GetFramebufferPixels(void* pixels, | |
| 650 const gfx::Rect& rect) { | |
| 651 TRACE_EVENT0("cc", "SoftwareRenderer::GetFramebufferPixels"); | |
| 652 gfx::Rect frame_rect(rect); | |
| 653 frame_rect += current_viewport_rect_.OffsetFromOrigin(); | |
| 654 output_device_->CopyToPixels(frame_rect, pixels); | |
| 655 } | |
| 656 | |
| 657 void SoftwareRenderer::DidChangeVisibility() { | 649 void SoftwareRenderer::DidChangeVisibility() { |
| 658 if (visible()) | 650 if (visible()) |
| 659 EnsureBackbuffer(); | 651 EnsureBackbuffer(); |
| 660 else | 652 else |
| 661 DiscardBackbuffer(); | 653 DiscardBackbuffer(); |
| 662 } | 654 } |
| 663 | 655 |
| 664 } // namespace cc | 656 } // namespace cc |
| OLD | NEW |