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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 void SoftwareRenderer::BindFramebufferToOutputSurface(DrawingFrame* frame) { | 137 void SoftwareRenderer::BindFramebufferToOutputSurface(DrawingFrame* frame) { |
138 DCHECK(!output_surface_->HasExternalStencilTest()); | 138 DCHECK(!output_surface_->HasExternalStencilTest()); |
139 current_framebuffer_lock_ = nullptr; | 139 current_framebuffer_lock_ = nullptr; |
140 current_framebuffer_canvas_.clear(); | 140 current_framebuffer_canvas_.clear(); |
141 current_canvas_ = root_canvas_; | 141 current_canvas_ = root_canvas_; |
142 } | 142 } |
143 | 143 |
144 bool SoftwareRenderer::BindFramebufferToTexture( | 144 bool SoftwareRenderer::BindFramebufferToTexture( |
145 DrawingFrame* frame, | 145 DrawingFrame* frame, |
146 const ScopedResource* texture, | 146 const ScopedResource* texture) { |
147 const gfx::Rect& target_rect) { | |
148 DCHECK(texture->id()); | 147 DCHECK(texture->id()); |
149 | 148 |
150 // Explicitly release lock, otherwise we can crash when try to lock | 149 // Explicitly release lock, otherwise we can crash when try to lock |
151 // same texture again. | 150 // same texture again. |
152 current_framebuffer_lock_ = nullptr; | 151 current_framebuffer_lock_ = nullptr; |
153 current_framebuffer_lock_ = make_scoped_ptr( | 152 current_framebuffer_lock_ = make_scoped_ptr( |
154 new ResourceProvider::ScopedWriteLockSoftware( | 153 new ResourceProvider::ScopedWriteLockSoftware( |
155 resource_provider_, texture->id())); | 154 resource_provider_, texture->id())); |
156 current_framebuffer_canvas_ = | 155 current_framebuffer_canvas_ = |
157 skia::AdoptRef(new SkCanvas(current_framebuffer_lock_->sk_bitmap())); | 156 skia::AdoptRef(new SkCanvas(current_framebuffer_lock_->sk_bitmap())); |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 ApplyImageFilter(filter.get(), quad, &backdrop_bitmap); | 715 ApplyImageFilter(filter.get(), quad, &backdrop_bitmap); |
717 | 716 |
718 if (!filter_backdrop_image) | 717 if (!filter_backdrop_image) |
719 return nullptr; | 718 return nullptr; |
720 | 719 |
721 return skia::AdoptRef(filter_backdrop_image->newShader( | 720 return skia::AdoptRef(filter_backdrop_image->newShader( |
722 content_tile_mode, content_tile_mode, &filter_backdrop_transform)); | 721 content_tile_mode, content_tile_mode, &filter_backdrop_transform)); |
723 } | 722 } |
724 | 723 |
725 } // namespace cc | 724 } // namespace cc |
OLD | NEW |