OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CC_QUADS_LARGEST_DRAW_QUAD_H_ | 5 #ifndef CC_QUADS_LARGEST_DRAW_QUAD_H_ |
6 #define CC_QUADS_LARGEST_DRAW_QUAD_H_ | 6 #define CC_QUADS_LARGEST_DRAW_QUAD_H_ |
7 | 7 |
8 #include "cc/quads/render_pass_draw_quad.h" | |
danakj
2014/11/03 18:14:21
including this includes GL headers which was break
weiliangc
2014/11/03 18:42:46
Have to include for sizeof(). I don't think it can
jbroman
2014/11/03 18:44:27
I'm curious how this broke the build before; do yo
danakj
2014/11/03 18:50:36
It was a matter of include files including include
danakj
2014/11/03 18:50:36
Ya, it would mean a function returning a size inst
| |
9 #include "cc/quads/stream_video_draw_quad.h" | |
10 | |
8 namespace cc { | 11 namespace cc { |
9 class StreamVideoDrawQuad; | |
10 class RenderPassDrawQuad; | |
11 | 12 |
12 #if defined(ARCH_CPU_64_BITS) | 13 // The largest quad is either a RenderPassDrawQuad or a StreamVideoDrawQuad |
13 typedef RenderPassDrawQuad kLargestDrawQuad; | 14 // depends on hardware structure, so use a template to determine which is |
14 #else | 15 // larger. |
danakj
2014/11/03 18:14:21
TODO to use std::conditional when we can do that :
| |
15 typedef StreamVideoDrawQuad kLargestDrawQuad; | 16 template <bool RenderPassDrawQuadLarger> |
danakj
2014/11/03 18:14:21
render_pass_draw_quad_is_larger
| |
16 #endif | 17 struct LargerQuadOfEitherRenderPassOrStreamVideo { |
18 typedef RenderPassDrawQuad Type; | |
danakj
2014/11/03 18:14:21
using Type = RenderPassDrawQuad
jbroman
2014/11/03 18:28:25
If you don't mind drive-by...
Since you only ever
| |
19 }; | |
20 | |
21 template <> | |
22 struct LargerQuadOfEitherRenderPassOrStreamVideo<false> { | |
23 typedef StreamVideoDrawQuad Type; | |
danakj
2014/11/03 18:14:21
using Type = StreamVideoDrawQuad
| |
24 }; | |
25 | |
26 typedef LargerQuadOfEitherRenderPassOrStreamVideo<( | |
danakj
2014/11/03 18:14:21
using kLargestDrawQuad = ...
| |
27 sizeof(RenderPassDrawQuad) > sizeof(StreamVideoDrawQuad))>::Type | |
28 kLargestDrawQuad; | |
17 | 29 |
18 } // namespace cc | 30 } // namespace cc |
19 | 31 |
20 #endif // CC_QUADS_LARGEST_DRAW_QUAD_H_ | 32 #endif // CC_QUADS_LARGEST_DRAW_QUAD_H_ |
OLD | NEW |