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

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

Issue 2326153002: Revert of Fix kLargestDrawQuadSize (Closed)
Patch Set: Created 4 years, 3 months 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 | « cc/quads/draw_quad_unittest.cc ('k') | 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 #include "cc/quads/largest_draw_quad.h" 5 #include "cc/quads/largest_draw_quad.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 #include "cc/quads/debug_border_draw_quad.h" 11 #include "cc/quads/debug_border_draw_quad.h"
12 #include "cc/quads/picture_draw_quad.h" 12 #include "cc/quads/picture_draw_quad.h"
13 #include "cc/quads/render_pass_draw_quad.h" 13 #include "cc/quads/render_pass_draw_quad.h"
14 #include "cc/quads/solid_color_draw_quad.h" 14 #include "cc/quads/solid_color_draw_quad.h"
15 #include "cc/quads/stream_video_draw_quad.h" 15 #include "cc/quads/stream_video_draw_quad.h"
16 #include "cc/quads/surface_draw_quad.h" 16 #include "cc/quads/surface_draw_quad.h"
17 #include "cc/quads/texture_draw_quad.h" 17 #include "cc/quads/texture_draw_quad.h"
18 #include "cc/quads/tile_draw_quad.h" 18 #include "cc/quads/tile_draw_quad.h"
19 #include "cc/quads/yuv_video_draw_quad.h" 19 #include "cc/quads/yuv_video_draw_quad.h"
20 20
21 namespace { 21 namespace {
22 const size_t kLargestDrawQuadSize = sizeof(cc::YUVVideoDrawQuad); 22 const size_t kLargestDrawQuadSize =
23 sizeof(cc::YUVVideoDrawQuad) + sizeof(gfx::ColorSpace);
23 } // namespace 24 } // namespace
24 25
25 namespace cc { 26 namespace cc {
26 27
27 size_t LargestDrawQuadSize() { 28 size_t LargestDrawQuadSize() {
28 // Currently the largest quad is either a RenderPassDrawQuad or a 29 // Currently the largest quad is either a RenderPassDrawQuad or a
29 // StreamVideoDrawQuad depends on hardware structure. 30 // StreamVideoDrawQuad depends on hardware structure.
30 31
31 // Use compile assert to make sure largest is actually larger than all other 32 // Use compile assert to make sure largest is actually larger than all other
32 // type of draw quads. 33 // type of draw quads.
(...skipping 16 matching lines...) Expand all
49 "Largest Draw Quad size needs update. TileDrawQuad is " 50 "Largest Draw Quad size needs update. TileDrawQuad is "
50 "currently largest."); 51 "currently largest.");
51 static_assert(sizeof(YUVVideoDrawQuad) <= kLargestDrawQuadSize, 52 static_assert(sizeof(YUVVideoDrawQuad) <= kLargestDrawQuadSize,
52 "Largest Draw Quad size needs update. YUVVideoDrawQuad is " 53 "Largest Draw Quad size needs update. YUVVideoDrawQuad is "
53 "currently largest."); 54 "currently largest.");
54 55
55 return kLargestDrawQuadSize; 56 return kLargestDrawQuadSize;
56 } 57 }
57 58
58 } // namespace cc 59 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/draw_quad_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698