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/base/render_surface_filters.h" | 10 #include "cc/base/render_surface_filters.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
458 | 458 |
459 ResourceProvider::ScopedReadLockSoftware lock(resource_provider_, | 459 ResourceProvider::ScopedReadLockSoftware lock(resource_provider_, |
460 content_texture->id()); | 460 content_texture->id()); |
461 if (!lock.valid()) | 461 if (!lock.valid()) |
462 return; | 462 return; |
463 | 463 |
464 SkRect dest_rect = gfx::RectFToSkRect(QuadVertexRect()); | 464 SkRect dest_rect = gfx::RectFToSkRect(QuadVertexRect()); |
465 SkRect dest_visible_rect = gfx::RectFToSkRect( | 465 SkRect dest_visible_rect = gfx::RectFToSkRect( |
466 MathUtil::ScaleRectProportional(QuadVertexRect(), gfx::RectF(quad->rect), | 466 MathUtil::ScaleRectProportional(QuadVertexRect(), gfx::RectF(quad->rect), |
467 gfx::RectF(quad->visible_rect))); | 467 gfx::RectF(quad->visible_rect))); |
468 // TODO(sunxd): make this never be empty. | 468 SkRect content_rect = RectFToSkRect(quad->tex_coord_rect); |
enne (OOO)
2017/03/28 14:10:22
Thanks for that other change to always pass the te
sunxd
2017/03/29 16:00:23
Done.
| |
469 SkRect content_rect = | |
470 quad->tex_coord_rect.IsEmpty() | |
471 ? SkRect::MakeWH(quad->rect.width(), quad->rect.height()) | |
472 : RectFToSkRect(quad->tex_coord_rect); | |
473 | 469 |
474 const SkBitmap* content = lock.sk_bitmap(); | 470 const SkBitmap* content = lock.sk_bitmap(); |
475 | 471 |
476 sk_sp<SkImage> filter_image; | 472 sk_sp<SkImage> filter_image; |
477 const FilterOperations* filters = FiltersForPass(quad->render_pass_id); | 473 const FilterOperations* filters = FiltersForPass(quad->render_pass_id); |
478 if (filters) { | 474 if (filters) { |
479 DCHECK(!filters->IsEmpty()); | 475 DCHECK(!filters->IsEmpty()); |
480 sk_sp<SkImageFilter> image_filter = RenderSurfaceFilters::BuildImageFilter( | 476 sk_sp<SkImageFilter> image_filter = RenderSurfaceFilters::BuildImageFilter( |
481 *filters, gfx::SizeF(content_texture->size())); | 477 *filters, gfx::SizeF(content_texture->size())); |
482 if (image_filter) { | 478 if (image_filter) { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
723 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); | 719 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); |
724 | 720 |
725 if (!filter_backdrop_image) | 721 if (!filter_backdrop_image) |
726 return nullptr; | 722 return nullptr; |
727 | 723 |
728 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, | 724 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, |
729 &filter_backdrop_transform); | 725 &filter_backdrop_transform); |
730 } | 726 } |
731 | 727 |
732 } // namespace cc | 728 } // namespace cc |
OLD | NEW |