| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 CCDrawQuad_h | 5 #ifndef CCDrawQuad_h |
| 6 #define CCDrawQuad_h | 6 #define CCDrawQuad_h |
| 7 | 7 |
| 8 #include "cc/cc_export.h" |
| 8 #include "cc/shared_quad_state.h" | 9 #include "cc/shared_quad_state.h" |
| 9 | 10 |
| 10 namespace cc { | 11 namespace cc { |
| 11 | 12 |
| 12 // WARNING! All XYZDrawQuad classes must remain PODs (plain old data). | 13 // WARNING! All XYZDrawQuad classes must remain PODs (plain old data). |
| 13 // They are intended to be "serializable" by copying their raw bytes, so they | 14 // They are intended to be "serializable" by copying their raw bytes, so they |
| 14 // must not contain any non-bit-copyable member variables! | 15 // must not contain any non-bit-copyable member variables! |
| 15 // | 16 // |
| 16 // Furthermore, the class members need to be packed so they are aligned | 17 // Furthermore, the class members need to be packed so they are aligned |
| 17 // properly and don't have paddings/gaps, otherwise memory check tools | 18 // properly and don't have paddings/gaps, otherwise memory check tools |
| 18 // like Valgrind will complain about uninitialized memory usage when | 19 // like Valgrind will complain about uninitialized memory usage when |
| 19 // transferring these classes over the wire. | 20 // transferring these classes over the wire. |
| 20 #pragma pack(push, 4) | 21 #pragma pack(push, 4) |
| 21 | 22 |
| 22 // DrawQuad is a bag of data used for drawing a quad. Because different | 23 // DrawQuad is a bag of data used for drawing a quad. Because different |
| 23 // materials need different bits of per-quad data to render, classes that derive | 24 // materials need different bits of per-quad data to render, classes that derive |
| 24 // from DrawQuad store additional data in their derived instance. The Material | 25 // from DrawQuad store additional data in their derived instance. The Material |
| 25 // enum is used to "safely" downcast to the derived class. | 26 // enum is used to "safely" downcast to the derived class. |
| 26 class DrawQuad { | 27 class CC_EXPORT DrawQuad { |
| 27 public: | 28 public: |
| 28 enum Material { | 29 enum Material { |
| 29 Invalid, | 30 Invalid, |
| 30 Checkerboard, | 31 Checkerboard, |
| 31 DebugBorder, | 32 DebugBorder, |
| 32 IOSurfaceContent, | 33 IOSurfaceContent, |
| 33 RenderPass, | 34 RenderPass, |
| 34 TextureContent, | 35 TextureContent, |
| 35 SolidColor, | 36 SolidColor, |
| 36 TiledContent, | 37 TiledContent, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // Be default, this rect is empty. It is used when the shared quad state and
above | 84 // Be default, this rect is empty. It is used when the shared quad state and
above |
| 84 // variables determine that the quad is not fully opaque but may be partiall
y opaque. | 85 // variables determine that the quad is not fully opaque but may be partiall
y opaque. |
| 85 gfx::Rect m_opaqueRect; | 86 gfx::Rect m_opaqueRect; |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 #pragma pack(pop) | 89 #pragma pack(pop) |
| 89 | 90 |
| 90 } | 91 } |
| 91 | 92 |
| 92 #endif | 93 #endif |
| OLD | NEW |