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 | 144 |
145 bool SoftwareRenderer::BindFramebufferToTexture( | 145 bool SoftwareRenderer::BindFramebufferToTexture( |
146 DrawingFrame* frame, | 146 DrawingFrame* frame, |
147 const ScopedResource* texture, | 147 const ScopedResource* texture, |
148 gfx::Rect framebuffer_rect) { | 148 gfx::Rect framebuffer_rect) { |
149 current_framebuffer_lock_.reset(); | 149 current_framebuffer_lock_.reset(); |
150 current_framebuffer_lock_ = make_scoped_ptr( | 150 current_framebuffer_lock_ = make_scoped_ptr( |
151 new ResourceProvider::ScopedWriteLockSoftware( | 151 new ResourceProvider::ScopedWriteLockSoftware( |
152 resource_provider_, texture->id())); | 152 resource_provider_, texture->id())); |
153 current_canvas_ = current_framebuffer_lock_->sk_canvas(); | 153 current_canvas_ = current_framebuffer_lock_->sk_canvas(); |
154 InitializeMatrices(frame, framebuffer_rect, false); | 154 InitializeMatrices(frame, gfx::Vector2d(), framebuffer_rect, false); |
155 SetDrawViewportSize(framebuffer_rect.size()); | 155 SetDrawViewportSize(framebuffer_rect.size()); |
156 | 156 |
157 return true; | 157 return true; |
158 } | 158 } |
159 | 159 |
160 void SoftwareRenderer::SetScissorTestRect(gfx::Rect scissor_rect) { | 160 void SoftwareRenderer::SetScissorTestRect(gfx::Rect scissor_rect) { |
161 is_scissor_enabled_ = true; | 161 is_scissor_enabled_ = true; |
162 scissor_rect_ = scissor_rect; | 162 scissor_rect_ = scissor_rect; |
163 SetClipRect(scissor_rect); | 163 SetClipRect(scissor_rect); |
164 } | 164 } |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 4 * rect.width()); | 456 4 * rect.width()); |
457 } | 457 } |
458 | 458 |
459 void SoftwareRenderer::SetVisible(bool visible) { | 459 void SoftwareRenderer::SetVisible(bool visible) { |
460 if (visible_ == visible) | 460 if (visible_ == visible) |
461 return; | 461 return; |
462 visible_ = visible; | 462 visible_ = visible; |
463 } | 463 } |
464 | 464 |
465 } // namespace cc | 465 } // namespace cc |
OLD | NEW |