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

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

Issue 1470123002: Split ClipTransformRecorder into {Clip,Transform}Recorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize transformed to false. 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
« no previous file with comments | « ui/compositor/BUILD.gn ('k') | ui/compositor/clip_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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_COMPOSITOR_CLIP_RECORDER_H_
6 #define UI_COMPOSITOR_CLIP_RECORDER_H_
7
8 #include "base/macros.h"
9 #include "ui/compositor/compositor_export.h"
10
11 namespace cc {
12 class DisplayItem;
13 class DisplayItemList;
14 }
15
16 namespace gfx {
17 class Path;
18 class Rect;
19 }
20
21 namespace ui {
22 class PaintContext;
23
24 // A class to provide scoped clips of painting to a DisplayItemList. The clip
25 // provided will be applied to any DisplayItems added to the DisplayItemList
26 // while this object is alive. In other words, any nested PaintRecorders or
27 // other ClipRecorders will be clipped.
28 class COMPOSITOR_EXPORT ClipRecorder {
29 public:
30 explicit ClipRecorder(const PaintContext& context);
31 ~ClipRecorder();
32
33 void ClipRect(const gfx::Rect& clip_rect);
34 void ClipPath(const gfx::Path& clip_path);
35 void ClipPathWithAntiAliasing(const gfx::Path& clip_path);
36
37 private:
38 enum Closer {
39 CLIP_RECT,
40 CLIP_PATH,
41 };
42 const PaintContext& context_;
43 // If someone needs to do more than this many operations with a single
44 // ClipRecorder then increase the size of the closers_ array.
45 Closer closers_[4];
46 size_t num_closers_;
47
48 DISALLOW_COPY_AND_ASSIGN(ClipRecorder);
49 };
50
51 } // namespace ui
52
53 #endif // UI_COMPOSITOR_CLIP_RECORDER_H_
OLDNEW
« no previous file with comments | « ui/compositor/BUILD.gn ('k') | ui/compositor/clip_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698