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

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

Issue 1855273002: Update new Surface callsites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: software_output_device was indirectly including skia::refptr, switch to sk_sp<> Created 4 years, 8 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
« no previous file with comments | « cc/output/software_output_device.cc ('k') | cc/playback/display_item_list_unittest.cc » ('j') | 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/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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 629
630 skia::RefPtr<SkImage> SoftwareRenderer::ApplyImageFilter( 630 skia::RefPtr<SkImage> SoftwareRenderer::ApplyImageFilter(
631 SkImageFilter* filter, 631 SkImageFilter* filter,
632 const RenderPassDrawQuad* quad, 632 const RenderPassDrawQuad* quad,
633 const SkBitmap* to_filter) const { 633 const SkBitmap* to_filter) const {
634 if (!filter) 634 if (!filter)
635 return nullptr; 635 return nullptr;
636 636
637 SkImageInfo dst_info = 637 SkImageInfo dst_info =
638 SkImageInfo::MakeN32Premul(to_filter->width(), to_filter->height()); 638 SkImageInfo::MakeN32Premul(to_filter->width(), to_filter->height());
639 skia::RefPtr<SkSurface> surface = 639 sk_sp<SkSurface> surface = SkSurface::MakeRaster(dst_info);
640 skia::AdoptRef(SkSurface::NewRaster(dst_info));
641 640
642 SkMatrix localM; 641 SkMatrix localM;
643 localM.setTranslate(SkIntToScalar(-quad->rect.origin().x()), 642 localM.setTranslate(SkIntToScalar(-quad->rect.origin().x()),
644 SkIntToScalar(-quad->rect.origin().y())); 643 SkIntToScalar(-quad->rect.origin().y()));
645 localM.preScale(quad->filters_scale.x(), quad->filters_scale.y()); 644 localM.preScale(quad->filters_scale.x(), quad->filters_scale.y());
646 645
647 SkPaint paint; 646 SkPaint paint;
648 paint.setImageFilter(filter->makeWithLocalMatrix(localM)); 647 paint.setImageFilter(filter->makeWithLocalMatrix(localM));
649 surface->getCanvas()->drawBitmap(*to_filter, 0, 0, &paint); 648 surface->getCanvas()->drawBitmap(*to_filter, 0, 0, &paint);
650 649
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 ApplyImageFilter(filter.get(), quad, &backdrop_bitmap); 714 ApplyImageFilter(filter.get(), quad, &backdrop_bitmap);
716 715
717 if (!filter_backdrop_image) 716 if (!filter_backdrop_image)
718 return nullptr; 717 return nullptr;
719 718
720 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, 719 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode,
721 &filter_backdrop_transform); 720 &filter_backdrop_transform);
722 } 721 }
723 722
724 } // namespace cc 723 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/software_output_device.cc ('k') | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698