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/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 bool SoftwareRenderer::BindFramebufferToTexture( | 130 bool SoftwareRenderer::BindFramebufferToTexture( |
131 DrawingFrame* frame, | 131 DrawingFrame* frame, |
132 const ScopedResource* texture) { | 132 const ScopedResource* texture) { |
133 DCHECK(texture->id()); | 133 DCHECK(texture->id()); |
134 | 134 |
135 // Explicitly release lock, otherwise we can crash when try to lock | 135 // Explicitly release lock, otherwise we can crash when try to lock |
136 // same texture again. | 136 // same texture again. |
137 current_framebuffer_lock_ = nullptr; | 137 current_framebuffer_lock_ = nullptr; |
138 current_framebuffer_lock_ = | 138 current_framebuffer_lock_ = |
139 base::WrapUnique(new ResourceProvider::ScopedWriteLockSoftware( | 139 base::MakeUnique<ResourceProvider::ScopedWriteLockSoftware>( |
140 resource_provider_, texture->id())); | 140 resource_provider_, texture->id()); |
141 current_framebuffer_canvas_ = | 141 current_framebuffer_canvas_ = |
142 sk_make_sp<SkCanvas>(current_framebuffer_lock_->sk_bitmap()); | 142 sk_make_sp<SkCanvas>(current_framebuffer_lock_->sk_bitmap()); |
143 current_canvas_ = current_framebuffer_canvas_.get(); | 143 current_canvas_ = current_framebuffer_canvas_.get(); |
144 return true; | 144 return true; |
145 } | 145 } |
146 | 146 |
147 void SoftwareRenderer::SetScissorTestRect(const gfx::Rect& scissor_rect) { | 147 void SoftwareRenderer::SetScissorTestRect(const gfx::Rect& scissor_rect) { |
148 is_scissor_enabled_ = true; | 148 is_scissor_enabled_ = true; |
149 scissor_rect_ = scissor_rect; | 149 scissor_rect_ = scissor_rect; |
150 SetClipRect(scissor_rect); | 150 SetClipRect(scissor_rect); |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); | 719 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); |
720 | 720 |
721 if (!filter_backdrop_image) | 721 if (!filter_backdrop_image) |
722 return nullptr; | 722 return nullptr; |
723 | 723 |
724 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, | 724 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, |
725 &filter_backdrop_transform); | 725 &filter_backdrop_transform); |
726 } | 726 } |
727 | 727 |
728 } // namespace cc | 728 } // namespace cc |
OLD | NEW |