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

Side by Side Diff: skia/ext/opacity_filter_canvas.cc

Issue 1925433002: Replace SkTLazy with base::Optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove Patch Created 4 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "skia/ext/opacity_filter_canvas.h" 5 #include "skia/ext/opacity_filter_canvas.h"
6 #include "third_party/skia/include/core/SkPaint.h" 6 #include "third_party/skia/include/core/SkPaint.h"
7 #include "third_party/skia/include/core/SkTLazy.h"
8 7
9 namespace skia { 8 namespace skia {
10 9
11 OpacityFilterCanvas::OpacityFilterCanvas(SkCanvas* canvas, 10 OpacityFilterCanvas::OpacityFilterCanvas(SkCanvas* canvas,
12 float opacity, 11 float opacity,
13 bool disable_image_filtering) 12 bool disable_image_filtering)
14 : INHERITED(canvas), 13 : INHERITED(canvas),
15 alpha_(SkScalarRoundToInt(opacity * 255)), 14 alpha_(SkScalarRoundToInt(opacity * 255)),
16 disable_image_filtering_(disable_image_filtering) { } 15 disable_image_filtering_(disable_image_filtering) { }
17 16
(...skipping 15 matching lines...) Expand all
33 const SkMatrix* matrix, 32 const SkMatrix* matrix,
34 const SkPaint* paint) { 33 const SkPaint* paint) {
35 SkTCopyOnFirstWrite<SkPaint> filteredPaint(paint); 34 SkTCopyOnFirstWrite<SkPaint> filteredPaint(paint);
36 if (this->onFilter(&filteredPaint, kPicture_Type)) { 35 if (this->onFilter(&filteredPaint, kPicture_Type)) {
37 // Unfurl pictures in order to filter nested paints. 36 // Unfurl pictures in order to filter nested paints.
38 this->SkCanvas::onDrawPicture(picture, matrix, filteredPaint); 37 this->SkCanvas::onDrawPicture(picture, matrix, filteredPaint);
39 } 38 }
40 } 39 }
41 40
42 } // namespace skia 41 } // namespace skia
OLDNEW
« cc/playback/image_hijack_canvas.cc ('K') | « skia/ext/benchmarking_canvas.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698