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/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 const ScopedResource* texture) { | 121 const ScopedResource* texture) { |
122 DCHECK(texture->id()); | 122 DCHECK(texture->id()); |
123 | 123 |
124 // Explicitly release lock, otherwise we can crash when try to lock | 124 // Explicitly release lock, otherwise we can crash when try to lock |
125 // same texture again. | 125 // same texture again. |
126 current_framebuffer_lock_ = nullptr; | 126 current_framebuffer_lock_ = nullptr; |
127 current_framebuffer_lock_ = | 127 current_framebuffer_lock_ = |
128 base::MakeUnique<ResourceProvider::ScopedWriteLockSoftware>( | 128 base::MakeUnique<ResourceProvider::ScopedWriteLockSoftware>( |
129 resource_provider_, texture->id()); | 129 resource_provider_, texture->id()); |
130 current_framebuffer_canvas_ = | 130 current_framebuffer_canvas_ = |
131 base::MakeUnique<SkCanvas>(current_framebuffer_lock_->sk_bitmap()); | 131 sk_make_sp<SkCanvas>(current_framebuffer_lock_->sk_bitmap()); |
132 current_canvas_ = current_framebuffer_canvas_.get(); | 132 current_canvas_ = current_framebuffer_canvas_.get(); |
133 return true; | 133 return true; |
134 } | 134 } |
135 | 135 |
136 void SoftwareRenderer::SetScissorTestRect(const gfx::Rect& scissor_rect) { | 136 void SoftwareRenderer::SetScissorTestRect(const gfx::Rect& scissor_rect) { |
137 is_scissor_enabled_ = true; | 137 is_scissor_enabled_ = true; |
138 scissor_rect_ = scissor_rect; | 138 scissor_rect_ = scissor_rect; |
139 SetClipRect(scissor_rect); | 139 SetClipRect(scissor_rect); |
140 } | 140 } |
141 | 141 |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); | 714 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); |
715 | 715 |
716 if (!filter_backdrop_image) | 716 if (!filter_backdrop_image) |
717 return nullptr; | 717 return nullptr; |
718 | 718 |
719 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, | 719 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, |
720 &filter_backdrop_transform); | 720 &filter_backdrop_transform); |
721 } | 721 } |
722 | 722 |
723 } // namespace cc | 723 } // namespace cc |
OLD | NEW |