OLD | NEW |
| (Empty) |
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_IO_SURFACE_DRAW_QUAD_H_ | |
6 #define CC_QUADS_IO_SURFACE_DRAW_QUAD_H_ | |
7 | |
8 #include <stddef.h> | |
9 | |
10 #include <memory> | |
11 | |
12 #include "cc/base/cc_export.h" | |
13 #include "cc/quads/draw_quad.h" | |
14 #include "ui/gfx/geometry/size.h" | |
15 | |
16 namespace cc { | |
17 | |
18 class CC_EXPORT IOSurfaceDrawQuad : public DrawQuad { | |
19 public: | |
20 enum Orientation { | |
21 FLIPPED, | |
22 UNFLIPPED, | |
23 ORIENTATION_LAST = UNFLIPPED | |
24 }; | |
25 | |
26 IOSurfaceDrawQuad(); | |
27 | |
28 void SetNew(const SharedQuadState* shared_quad_state, | |
29 const gfx::Rect& rect, | |
30 const gfx::Rect& opaque_rect, | |
31 const gfx::Rect& visible_rect, | |
32 const gfx::Size& io_surface_size, | |
33 unsigned io_surface_resource_id, | |
34 Orientation orientation); | |
35 | |
36 void SetAll(const SharedQuadState* shared_quad_state, | |
37 const gfx::Rect& rect, | |
38 const gfx::Rect& opaque_rect, | |
39 const gfx::Rect& visible_rect, | |
40 bool needs_blending, | |
41 const gfx::Size& io_surface_size, | |
42 unsigned io_surface_resource_id, | |
43 Orientation orientation); | |
44 | |
45 gfx::Size io_surface_size; | |
46 Orientation orientation; | |
47 | |
48 ResourceId io_surface_resource_id() const { | |
49 return resources.ids[kIOSurfaceResourceIdIndex]; | |
50 } | |
51 | |
52 static const IOSurfaceDrawQuad* MaterialCast(const DrawQuad*); | |
53 | |
54 private: | |
55 static const size_t kIOSurfaceResourceIdIndex = 0; | |
56 | |
57 void ExtendValue(base::trace_event::TracedValue* value) const override; | |
58 }; | |
59 | |
60 } // namespace cc | |
61 | |
62 #endif // CC_QUADS_IO_SURFACE_DRAW_QUAD_H_ | |
OLD | NEW |