| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 void SoftwareRenderer::BindFramebufferToOutputSurface(DrawingFrame* frame) { | 149 void SoftwareRenderer::BindFramebufferToOutputSurface(DrawingFrame* frame) { |
| 150 current_framebuffer_lock_.reset(); | 150 current_framebuffer_lock_.reset(); |
| 151 current_canvas_ = root_canvas_; | 151 current_canvas_ = root_canvas_; |
| 152 } | 152 } |
| 153 | 153 |
| 154 bool SoftwareRenderer::BindFramebufferToTexture( | 154 bool SoftwareRenderer::BindFramebufferToTexture( |
| 155 DrawingFrame* frame, | 155 DrawingFrame* frame, |
| 156 const ScopedResource* texture, | 156 const ScopedResource* texture, |
| 157 gfx::Rect framebuffer_rect) { | 157 gfx::Rect framebuffer_rect) { |
| 158 current_framebuffer_lock_.reset(); |
| 158 current_framebuffer_lock_ = make_scoped_ptr( | 159 current_framebuffer_lock_ = make_scoped_ptr( |
| 159 new ResourceProvider::ScopedWriteLockSoftware( | 160 new ResourceProvider::ScopedWriteLockSoftware( |
| 160 resource_provider_, texture->id())); | 161 resource_provider_, texture->id())); |
| 161 current_canvas_ = current_framebuffer_lock_->sk_canvas(); | 162 current_canvas_ = current_framebuffer_lock_->sk_canvas(); |
| 162 InitializeMatrices(frame, framebuffer_rect, false); | 163 InitializeMatrices(frame, framebuffer_rect, false); |
| 163 SetDrawViewportSize(framebuffer_rect.size()); | 164 SetDrawViewportSize(framebuffer_rect.size()); |
| 164 | 165 |
| 165 return true; | 166 return true; |
| 166 } | 167 } |
| 167 | 168 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 4 * rect.width()); | 428 4 * rect.width()); |
| 428 } | 429 } |
| 429 | 430 |
| 430 void SoftwareRenderer::SetVisible(bool visible) { | 431 void SoftwareRenderer::SetVisible(bool visible) { |
| 431 if (visible_ == visible) | 432 if (visible_ == visible) |
| 432 return; | 433 return; |
| 433 visible_ = visible; | 434 visible_ = visible; |
| 434 } | 435 } |
| 435 | 436 |
| 436 } // namespace cc | 437 } // namespace cc |
| OLD | NEW |