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

Side by Side Diff: ui/compositor/compositing_recorder.h

Issue 1506203008: Allow background tab titles to use LCD AA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use new Skia API name Created 5 years 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 #ifndef UI_COMPOSITOR_COMPOSITING_RECORDER_H_ 5 #ifndef UI_COMPOSITOR_COMPOSITING_RECORDER_H_
6 #define UI_COMPOSITOR_COMPOSITING_RECORDER_H_ 6 #define UI_COMPOSITOR_COMPOSITING_RECORDER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "ui/compositor/compositor_export.h" 10 #include "ui/compositor/compositor_export.h"
11 #include "ui/gfx/geometry/rect.h" 11 #include "ui/gfx/geometry/rect.h"
12 12
13 namespace gfx { 13 namespace gfx {
14 class Size; 14 class Size;
15 } 15 }
16 16
17 namespace ui { 17 namespace ui {
18 class PaintContext; 18 class PaintContext;
19 19
20 // A class to provide scoped compositing filters (eg opacity) of painting to a 20 // A class to provide scoped compositing filters (eg opacity) of painting to a
21 // DisplayItemList. The filters provided will be applied to any 21 // DisplayItemList. The filters provided will be applied to any
22 // DisplayItems added to the DisplayItemList while this object is alive. In 22 // DisplayItems added to the DisplayItemList while this object is alive. In
23 // other words, any nested PaintRecorders or other such Recorders will 23 // other words, any nested PaintRecorders or other such Recorders will
24 // be filtered by the effect. 24 // be filtered by the effect.
25 class COMPOSITOR_EXPORT CompositingRecorder { 25 class COMPOSITOR_EXPORT CompositingRecorder {
26 public: 26 public:
27 // |alpha| is a value between 0 and 255, where 0 is transparent and 255 is 27 // |alpha| is a value between 0 and 255, where 0 is transparent and 255 is
28 // opaque. |size_in_context| is the size in the |context|'s space surrounding 28 // opaque. |size_in_context| is the size in the |context|'s space surrounding
29 // everything that's visible. 29 // everything that's visible. |allow_lcd_text| can be set to true to allow
30 // the underlying Skia layer to use LCD AA for text rendering, if you know the
31 // text is being drawn opaquely on an opaque background before compositing.
30 CompositingRecorder(const PaintContext& context, 32 CompositingRecorder(const PaintContext& context,
31 const gfx::Size& size_in_context, 33 const gfx::Size& size_in_context,
32 uint8_t alpha); 34 uint8_t alpha,
35 bool allow_lcd_text);
danakj 2015/12/11 19:07:00 same comment about the name here
33 ~CompositingRecorder(); 36 ~CompositingRecorder();
34 37
35 private: 38 private:
36 const PaintContext& context_; 39 const PaintContext& context_;
37 const gfx::Rect bounds_in_layer_; 40 const gfx::Rect bounds_in_layer_;
38 bool saved_; 41 bool saved_;
39 42
40 DISALLOW_COPY_AND_ASSIGN(CompositingRecorder); 43 DISALLOW_COPY_AND_ASSIGN(CompositingRecorder);
41 }; 44 };
42 45
43 } // namespace ui 46 } // namespace ui
44 47
45 #endif // UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_ 48 #endif // UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698