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

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

Issue 1849213002: Remove SK_SUPPORT_LEGACY_XFERMODE_PTR (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adopt the pointer but don't ref it 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
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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 635
636 SkImageInfo dst_info = 636 SkImageInfo dst_info =
637 SkImageInfo::MakeN32Premul(to_filter->width(), to_filter->height()); 637 SkImageInfo::MakeN32Premul(to_filter->width(), to_filter->height());
638 skia::RefPtr<SkSurface> surface = 638 skia::RefPtr<SkSurface> surface =
639 skia::AdoptRef(SkSurface::NewRaster(dst_info)); 639 skia::AdoptRef(SkSurface::NewRaster(dst_info));
640 640
641 SkMatrix localM; 641 SkMatrix localM;
642 localM.setTranslate(SkIntToScalar(-quad->rect.origin().x()), 642 localM.setTranslate(SkIntToScalar(-quad->rect.origin().x()),
643 SkIntToScalar(-quad->rect.origin().y())); 643 SkIntToScalar(-quad->rect.origin().y()));
644 localM.preScale(quad->filters_scale.x(), quad->filters_scale.y()); 644 localM.preScale(quad->filters_scale.x(), quad->filters_scale.y());
645 skia::RefPtr<SkImageFilter> localIMF = 645 sk_sp<SkImageFilter> localIMF = filter->makeWithLocalMatrix(localM);
646 skia::AdoptRef(filter->newWithLocalMatrix(localM));
647 646
648 SkPaint paint; 647 SkPaint paint;
649 paint.setImageFilter(localIMF.get()); 648 paint.setImageFilter(localIMF);
f(malita) 2016/04/01 18:16:00 std::move or inline.
650 surface->getCanvas()->drawBitmap(*to_filter, 0, 0, &paint); 649 surface->getCanvas()->drawBitmap(*to_filter, 0, 0, &paint);
651 650
652 return skia::AdoptRef(surface->newImageSnapshot()); 651 return skia::AdoptRef(surface->newImageSnapshot());
653 } 652 }
654 653
655 SkBitmap SoftwareRenderer::GetBackdropBitmap( 654 SkBitmap SoftwareRenderer::GetBackdropBitmap(
656 const gfx::Rect& bounding_rect) const { 655 const gfx::Rect& bounding_rect) const {
657 SkBitmap bitmap; 656 SkBitmap bitmap;
658 bitmap.setInfo(SkImageInfo::MakeN32Premul(bounding_rect.width(), 657 bitmap.setInfo(SkImageInfo::MakeN32Premul(bounding_rect.width(),
659 bounding_rect.height())); 658 bounding_rect.height()));
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 ApplyImageFilter(filter.get(), quad, &backdrop_bitmap); 715 ApplyImageFilter(filter.get(), quad, &backdrop_bitmap);
717 716
718 if (!filter_backdrop_image) 717 if (!filter_backdrop_image)
719 return nullptr; 718 return nullptr;
720 719
721 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, 720 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode,
722 &filter_backdrop_transform); 721 &filter_backdrop_transform);
723 } 722 }
724 723
725 } // namespace cc 724 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698