• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2012 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 CC_QUADS_SHARED_QUAD_STATE_H_
6 #define CC_QUADS_SHARED_QUAD_STATE_H_
7 
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/base/cc_export.h"
10 #include "third_party/skia/include/core/SkXfermode.h"
11 #include "ui/gfx/rect.h"
12 #include "ui/gfx/transform.h"
13 
14 namespace base {
15 class Value;
16 }
17 
18 namespace cc {
19 
20 class CC_EXPORT SharedQuadState {
21  public:
22   static scoped_ptr<SharedQuadState> Create();
23   ~SharedQuadState();
24 
25   scoped_ptr<SharedQuadState> Copy() const;
26 
27   void SetAll(const gfx::Transform& content_to_target_transform,
28               gfx::Size content_bounds,
29               gfx::Rect visible_content_rect,
30               gfx::Rect clip_rect,
31               bool is_clipped,
32               float opacity,
33               SkXfermode::Mode blend_mode);
34   scoped_ptr<base::Value> AsValue() const;
35 
36   // Transforms from quad's original content space to its target content space.
37   gfx::Transform content_to_target_transform;
38   // This size lives in the content space for the quad's originating layer.
39   gfx::Size content_bounds;
40   // This rect lives in the content space for the quad's originating layer.
41   gfx::Rect visible_content_rect;
42   // This rect lives in the target content space.
43   gfx::Rect clip_rect;
44   bool is_clipped;
45   float opacity;
46   SkXfermode::Mode blend_mode;
47 
48  private:
49   SharedQuadState();
50 };
51 
52 }  // namespace cc
53 
54 #endif  // CC_QUADS_SHARED_QUAD_STATE_H_
55