| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 void SoftwareRenderer::EnsureScissorTestDisabled() { | 123 void SoftwareRenderer::EnsureScissorTestDisabled() { |
| 124 // There is no explicit notion of enabling/disabling scissoring in software | 124 // There is no explicit notion of enabling/disabling scissoring in software |
| 125 // rendering, but the underlying effect we want is to clear any existing | 125 // rendering, but the underlying effect we want is to clear any existing |
| 126 // clipRect on the current SkCanvas. This is done by setting clipRect to | 126 // clipRect on the current SkCanvas. This is done by setting clipRect to |
| 127 // the viewport's dimensions. | 127 // the viewport's dimensions. |
| 128 if (!current_canvas_) | 128 if (!current_canvas_) |
| 129 return; | 129 return; |
| 130 is_scissor_enabled_ = false; | 130 is_scissor_enabled_ = false; |
| 131 SkISize size = current_canvas_->getDeviceSize(); | 131 SkISize size = current_canvas_->getBaseLayerSize(); |
| 132 SetClipRect(gfx::Rect(size.width(), size.height())); | 132 SetClipRect(gfx::Rect(size.width(), size.height())); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void SoftwareRenderer::Finish() {} | 135 void SoftwareRenderer::Finish() {} |
| 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_; |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 | 713 |
| 714 if (filter_backdrop_bitmap.empty()) | 714 if (filter_backdrop_bitmap.empty()) |
| 715 return skia::RefPtr<SkShader>(); | 715 return skia::RefPtr<SkShader>(); |
| 716 | 716 |
| 717 return skia::AdoptRef(SkShader::CreateBitmapShader( | 717 return skia::AdoptRef(SkShader::CreateBitmapShader( |
| 718 filter_backdrop_bitmap, content_tile_mode, content_tile_mode, | 718 filter_backdrop_bitmap, content_tile_mode, content_tile_mode, |
| 719 &filter_backdrop_transform)); | 719 &filter_backdrop_transform)); |
| 720 } | 720 } |
| 721 | 721 |
| 722 } // namespace cc | 722 } // namespace cc |
| OLD | NEW |