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

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

Issue 1062293003: tabstrip: Use a PaintRecorder to access the Canvas for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tabstrip-recorder: missing8 Created 5 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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | ui/compositor/compositing_recorder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/macros.h" 9 #include "base/macros.h"
9 #include "ui/compositor/compositor_export.h" 10 #include "ui/compositor/compositor_export.h"
10 11
11 namespace gfx { 12 namespace gfx {
12 class Canvas; 13 class Canvas;
13 } 14 }
14 15
15 namespace ui { 16 namespace ui {
16 class PaintContext; 17 class PaintContext;
17 18
18 // A class to provide scoped compositing filters (eg opacity) of painting to a 19 // A class to provide scoped compositing filters (eg opacity) of painting to a
19 // DisplayItemList. The filters provided will be applied to any 20 // DisplayItemList. The filters provided will be applied to any
20 // DisplayItems added to the DisplayItemList while this object is alive. In 21 // DisplayItems added to the DisplayItemList while this object is alive. In
21 // other words, any nested PaintRecorders or other such Recorders will 22 // other words, any nested PaintRecorders or other such Recorders will
22 // be filtered by the effect. 23 // be filtered by the effect.
23 class COMPOSITOR_EXPORT CompositingRecorder { 24 class COMPOSITOR_EXPORT CompositingRecorder {
24 public: 25 public:
25 CompositingRecorder(const PaintContext& context, float opacity); 26 // |alpha| is a value between 0 and 255, where 0 is transparent and 255 is
27 // opaque.
28 CompositingRecorder(const PaintContext& context, uint8_t alpha);
26 ~CompositingRecorder(); 29 ~CompositingRecorder();
27 30
28 private: 31 private:
29 gfx::Canvas* canvas_; 32 gfx::Canvas* canvas_;
33 bool saved_;
30 34
31 DISALLOW_COPY_AND_ASSIGN(CompositingRecorder); 35 DISALLOW_COPY_AND_ASSIGN(CompositingRecorder);
32 }; 36 };
33 37
34 } // namespace ui 38 } // namespace ui
35 39
36 #endif // UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_ 40 #endif // UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | ui/compositor/compositing_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698