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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 // input bitmap. | 607 // input bitmap. |
608 sk_sp<SkImage> SoftwareRenderer::ApplyImageFilter( | 608 sk_sp<SkImage> SoftwareRenderer::ApplyImageFilter( |
609 SkImageFilter* filter, | 609 SkImageFilter* filter, |
610 const RenderPassDrawQuad* quad, | 610 const RenderPassDrawQuad* quad, |
611 const SkBitmap& to_filter, | 611 const SkBitmap& to_filter, |
612 SkIRect* auto_bounds) const { | 612 SkIRect* auto_bounds) const { |
613 if (!filter) | 613 if (!filter) |
614 return nullptr; | 614 return nullptr; |
615 | 615 |
616 SkMatrix local_matrix; | 616 SkMatrix local_matrix; |
617 local_matrix.setScale(quad->filters_scale.x(), quad->filters_scale.y()); | 617 local_matrix.setTranslate(quad->filters_origin.x(), quad->filters_origin.y()); |
| 618 local_matrix.postScale(quad->filters_scale.x(), quad->filters_scale.y()); |
618 SkIRect dst_rect; | 619 SkIRect dst_rect; |
619 if (auto_bounds) { | 620 if (auto_bounds) { |
620 dst_rect = | 621 dst_rect = |
621 filter->filterBounds(gfx::RectToSkIRect(quad->rect), local_matrix, | 622 filter->filterBounds(gfx::RectToSkIRect(quad->rect), local_matrix, |
622 SkImageFilter::kForward_MapDirection); | 623 SkImageFilter::kForward_MapDirection); |
623 *auto_bounds = dst_rect; | 624 *auto_bounds = dst_rect; |
624 } else { | 625 } else { |
625 dst_rect = to_filter.bounds(); | 626 dst_rect = to_filter.bounds(); |
626 } | 627 } |
627 | 628 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); | 710 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); |
710 | 711 |
711 if (!filter_backdrop_image) | 712 if (!filter_backdrop_image) |
712 return nullptr; | 713 return nullptr; |
713 | 714 |
714 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, | 715 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, |
715 &filter_backdrop_transform); | 716 &filter_backdrop_transform); |
716 } | 717 } |
717 | 718 |
718 } // namespace cc | 719 } // namespace cc |
OLD | NEW |