Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: cc/quads/largest_draw_quad.h

Issue 698053002: Choose Largest DrawQuad Type No Longer Depended on Compiler Flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698