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/trace_event/trace_event.h" | 7 #include "base/trace_event/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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 DCHECK(!output_surface_->HasExternalStencilTest()); | 153 DCHECK(!output_surface_->HasExternalStencilTest()); |
154 current_framebuffer_lock_ = nullptr; | 154 current_framebuffer_lock_ = nullptr; |
155 current_framebuffer_canvas_.clear(); | 155 current_framebuffer_canvas_.clear(); |
156 current_canvas_ = root_canvas_; | 156 current_canvas_ = root_canvas_; |
157 } | 157 } |
158 | 158 |
159 bool SoftwareRenderer::BindFramebufferToTexture( | 159 bool SoftwareRenderer::BindFramebufferToTexture( |
160 DrawingFrame* frame, | 160 DrawingFrame* frame, |
161 const ScopedResource* texture, | 161 const ScopedResource* texture, |
162 const gfx::Rect& target_rect) { | 162 const gfx::Rect& target_rect) { |
| 163 current_framebuffer_lock_ = nullptr; |
163 current_framebuffer_lock_ = make_scoped_ptr( | 164 current_framebuffer_lock_ = make_scoped_ptr( |
164 new ResourceProvider::ScopedWriteLockSoftware( | 165 new ResourceProvider::ScopedWriteLockSoftware( |
165 resource_provider_, texture->id())); | 166 resource_provider_, texture->id())); |
166 current_framebuffer_canvas_ = | 167 current_framebuffer_canvas_ = |
167 skia::AdoptRef(new SkCanvas(current_framebuffer_lock_->sk_bitmap())); | 168 skia::AdoptRef(new SkCanvas(current_framebuffer_lock_->sk_bitmap())); |
168 current_canvas_ = current_framebuffer_canvas_.get(); | 169 current_canvas_ = current_framebuffer_canvas_.get(); |
169 InitializeViewport(frame, | 170 InitializeViewport(frame, |
170 target_rect, | 171 target_rect, |
171 gfx::Rect(target_rect.size()), | 172 gfx::Rect(target_rect.size()), |
172 target_rect.size()); | 173 target_rect.size()); |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 } | 608 } |
608 | 609 |
609 void SoftwareRenderer::DidChangeVisibility() { | 610 void SoftwareRenderer::DidChangeVisibility() { |
610 if (visible()) | 611 if (visible()) |
611 EnsureBackbuffer(); | 612 EnsureBackbuffer(); |
612 else | 613 else |
613 DiscardBackbuffer(); | 614 DiscardBackbuffer(); |
614 } | 615 } |
615 | 616 |
616 } // namespace cc | 617 } // namespace cc |
OLD | NEW |