Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(873)

Side by Side Diff: cc/output/software_renderer.cc

Issue 2716893002: cc: Reformat renderers to make them work with mask tiling. (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« cc/output/gl_renderer.cc ('K') | « cc/output/gl_renderer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 453
454 ResourceProvider::ScopedReadLockSoftware lock(resource_provider_, 454 ResourceProvider::ScopedReadLockSoftware lock(resource_provider_,
455 content_texture->id()); 455 content_texture->id());
456 if (!lock.valid()) 456 if (!lock.valid())
457 return; 457 return;
458 458
459 SkRect dest_rect = gfx::RectFToSkRect(QuadVertexRect()); 459 SkRect dest_rect = gfx::RectFToSkRect(QuadVertexRect());
460 SkRect dest_visible_rect = gfx::RectFToSkRect( 460 SkRect dest_visible_rect = gfx::RectFToSkRect(
461 MathUtil::ScaleRectProportional(QuadVertexRect(), gfx::RectF(quad->rect), 461 MathUtil::ScaleRectProportional(QuadVertexRect(), gfx::RectF(quad->rect),
462 gfx::RectF(quad->visible_rect))); 462 gfx::RectF(quad->visible_rect)));
463 SkRect content_rect = SkRect::MakeWH(quad->rect.width(), quad->rect.height()); 463 SkRect content_rect =
464 quad->tex_coord_rect.IsEmpty()
465 ? SkRect::MakeWH(quad->rect.width(), quad->rect.height())
466 : RectFToSkRect(quad->tex_coord_rect);
464 467
465 const SkBitmap* content = lock.sk_bitmap(); 468 const SkBitmap* content = lock.sk_bitmap();
466 469
467 sk_sp<SkImage> filter_image; 470 sk_sp<SkImage> filter_image;
468 const FilterOperations* filters = FiltersForPass(quad->render_pass_id); 471 const FilterOperations* filters = FiltersForPass(quad->render_pass_id);
469 if (filters) { 472 if (filters) {
470 DCHECK(!filters->IsEmpty()); 473 DCHECK(!filters->IsEmpty());
471 sk_sp<SkImageFilter> image_filter = RenderSurfaceFilters::BuildImageFilter( 474 sk_sp<SkImageFilter> image_filter = RenderSurfaceFilters::BuildImageFilter(
472 *filters, gfx::SizeF(content_texture->size())); 475 *filters, gfx::SizeF(content_texture->size()));
473 if (image_filter) { 476 if (image_filter) {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); 713 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr);
711 714
712 if (!filter_backdrop_image) 715 if (!filter_backdrop_image)
713 return nullptr; 716 return nullptr;
714 717
715 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, 718 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode,
716 &filter_backdrop_transform); 719 &filter_backdrop_transform);
717 } 720 }
718 721
719 } // namespace cc 722 } // namespace cc
OLDNEW
« cc/output/gl_renderer.cc ('K') | « cc/output/gl_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698