Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / compositor / clip_transform_recorder.h
blob7ca70f3de3c16fad59bf7ac2971e64a05809f1ad
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.
5 #ifndef UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_
6 #define UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_
8 #include <vector>
10 #include "base/macros.h"
11 #include "ui/compositor/compositor_export.h"
13 namespace cc {
14 class DisplayItem;
15 class DisplayItemList;
18 namespace gfx {
19 class Path;
20 class Rect;
21 class Transform;
24 namespace ui {
25 class PaintContext;
27 // A class to provide scoped clips and transforms of painting to a
28 // DisplayItemList. The the clip/transform provided will be applied to any
29 // DisplayItems added to the DisplayItemList while this object is alive. In
30 // other words, any nested PaintRecorders or other ClipTransformRecorders will
31 // be clipped/transformed.
32 class COMPOSITOR_EXPORT ClipTransformRecorder {
33 public:
34 explicit ClipTransformRecorder(const PaintContext& context);
35 ~ClipTransformRecorder();
37 void ClipRect(const gfx::Rect& clip_rect);
38 void ClipPath(const gfx::Path& clip_path);
39 void ClipPathWithAntiAliasing(const gfx::Path& clip_path);
40 void Transform(const gfx::Transform& transform);
42 private:
43 const PaintContext& context_;
44 std::vector<cc::DisplayItem*> closers_;
46 DISALLOW_COPY_AND_ASSIGN(ClipTransformRecorder);
49 } // namespace ui
51 #endif // UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_