| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 | 571 |
| 572 std::unique_ptr<SkBitmap> bitmap(new SkBitmap); | 572 std::unique_ptr<SkBitmap> bitmap(new SkBitmap); |
| 573 bitmap->setInfo(SkImageInfo::MakeN32Premul(window_copy_rect.width(), | 573 bitmap->setInfo(SkImageInfo::MakeN32Premul(window_copy_rect.width(), |
| 574 window_copy_rect.height())); | 574 window_copy_rect.height())); |
| 575 current_canvas_->readPixels( | 575 current_canvas_->readPixels( |
| 576 bitmap.get(), window_copy_rect.x(), window_copy_rect.y()); | 576 bitmap.get(), window_copy_rect.x(), window_copy_rect.y()); |
| 577 | 577 |
| 578 request->SendBitmapResult(std::move(bitmap)); | 578 request->SendBitmapResult(std::move(bitmap)); |
| 579 } | 579 } |
| 580 | 580 |
| 581 void SoftwareRenderer::SetEnableDCLayers(bool enable) { |
| 582 NOTIMPLEMENTED(); |
| 583 } |
| 584 |
| 581 void SoftwareRenderer::DidChangeVisibility() { | 585 void SoftwareRenderer::DidChangeVisibility() { |
| 582 if (visible_) | 586 if (visible_) |
| 583 output_surface_->EnsureBackbuffer(); | 587 output_surface_->EnsureBackbuffer(); |
| 584 else | 588 else |
| 585 output_surface_->DiscardBackbuffer(); | 589 output_surface_->DiscardBackbuffer(); |
| 586 } | 590 } |
| 587 | 591 |
| 588 bool SoftwareRenderer::ShouldApplyBackgroundFilters( | 592 bool SoftwareRenderer::ShouldApplyBackgroundFilters( |
| 589 const RenderPassDrawQuad* quad, | 593 const RenderPassDrawQuad* quad, |
| 590 const FilterOperations* background_filters) const { | 594 const FilterOperations* background_filters) const { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); | 718 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); |
| 715 | 719 |
| 716 if (!filter_backdrop_image) | 720 if (!filter_backdrop_image) |
| 717 return nullptr; | 721 return nullptr; |
| 718 | 722 |
| 719 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, | 723 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, |
| 720 &filter_backdrop_transform); | 724 &filter_backdrop_transform); |
| 721 } | 725 } |
| 722 | 726 |
| 723 } // namespace cc | 727 } // namespace cc |
| OLD | NEW |