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

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

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 #ifndef SKIA_EXT_OPACITY_DRAW_FILTER_H
6 #define SKIA_EXT_OPACITY_DRAW_FILTER_H
7
8 #include "base/values.h"
9 #include "third_party/skia/include/core/SkDrawFilter.h"
10
11 class SkPaint;
12
13 namespace skia {
14
15 // This filter allows setting an opacity on every draw call to a canvas, and to
16 // disable image filtering. Note that setting opacity with this is only correct
17 // when there are no overlapping draw calls (as this doesn't allocate a bitmap
18 // to collapse them together before blending the result against the
19 // backbuffer).
20 class SK_API OpacityDrawFilter : public SkDrawFilter {
21 public:
22 OpacityDrawFilter(float opacity, bool disable_image_filtering);
23 virtual ~OpacityDrawFilter();
24 virtual bool filter(SkPaint* paint, SkDrawFilter::Type type) OVERRIDE;
25
26 private:
27 float opacity_;
tomhudson 2013/08/28 14:55:18 Why not store SkScalarRound(opacity_*255), instead
aelias_OOO_until_Jul13 2013/08/28 18:50:35 Done.
28 float disable_image_filtering_;
tomhudson 2013/08/28 14:55:18 bool?!
aelias_OOO_until_Jul13 2013/08/28 18:50:35 Oops, thanks for catching that.
29 };
30
31 } // namespace skia
32
33 #endif // SKIA_EXT_OPACITY_DRAW_FILTER_H
34
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698