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

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

Issue 22867046: Optimize alpha software PictureDrawQuads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO to comment Created 7 years, 3 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
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "skia/ext/opacity_draw_filter.h"
6 #include "third_party/skia/include/core/SkPaint.h"
7
8 namespace skia {
9
10 OpacityDrawFilter::OpacityDrawFilter(float opacity, bool disable_image_filtering )
11 : opacity_(opacity), disable_image_filtering_(disable_image_filtering) {}
12
13 OpacityDrawFilter::~OpacityDrawFilter() {}
14
15 bool OpacityDrawFilter::filter(SkPaint* paint, Type type) {
16 if (opacity_ != 1.f)
17 paint->setAlpha(SkScalarRound(opacity_ * 255));
tomhudson 2013/08/28 14:55:18 (Maybe arguing against my comment in the header)
aelias_OOO_until_Jul13 2013/08/28 18:50:35 There's an argument for multiplying, but for now I
18 if (disable_image_filtering_)
19 paint->setFilterLevel(SkPaint::kNone_FilterLevel);
20 return true;
21 }
22
23 } // namespace skia
24
25
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698