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

Unified Diff: cc/quads/largest_draw_quad.cc

Issue 2328433005: Fix kLargestDrawQuadSize (Closed)
Patch Set: try again 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/quads/draw_quad_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/largest_draw_quad.cc
diff --git a/cc/quads/largest_draw_quad.cc b/cc/quads/largest_draw_quad.cc
index 35c64314c6d87965e331a478f83e3537f3af7487..94c1785865f1acc322dd147c604634e8e20cede1 100644
--- a/cc/quads/largest_draw_quad.cc
+++ b/cc/quads/largest_draw_quad.cc
@@ -19,17 +19,25 @@
#include "cc/quads/yuv_video_draw_quad.h"
namespace {
-const size_t kLargestDrawQuadSize =
- sizeof(cc::YUVVideoDrawQuad) + sizeof(gfx::ColorSpace);
+const size_t kLargestDrawQuadSize1 = sizeof(cc::StreamVideoDrawQuad);
+const size_t kLargestDrawQuadSize2 = sizeof(cc::RenderPassDrawQuad) >
+ kLargestDrawQuadSize1
+ ? sizeof(cc::RenderPassDrawQuad)
+ : kLargestDrawQuadSize1;
+const size_t kLargestDrawQuadSize = sizeof(cc::YUVVideoDrawQuad) >
+ kLargestDrawQuadSize2
+ ? sizeof(cc::YUVVideoDrawQuad)
+ : kLargestDrawQuadSize2;
+
} // namespace
namespace cc {
size_t LargestDrawQuadSize() {
- // Currently the largest quad is either a RenderPassDrawQuad or a
- // StreamVideoDrawQuad depends on hardware structure.
+ // Currently the largest quad is either a RenderPassDrawQuad,
+ // StreamVideoDrawQuad or YUVVideoDrawQuad depending on hardware structure.
- // Use compile assert to make sure largest is actually larger than all other
+ // Use compile assert to make sure largest is actually larger than all
// type of draw quads.
static_assert(sizeof(DebugBorderDrawQuad) <= kLargestDrawQuadSize,
"Largest Draw Quad size needs update. DebugBorderDrawQuad is "
@@ -52,6 +60,12 @@ size_t LargestDrawQuadSize() {
static_assert(sizeof(YUVVideoDrawQuad) <= kLargestDrawQuadSize,
"Largest Draw Quad size needs update. YUVVideoDrawQuad is "
"currently largest.");
+ static_assert(sizeof(RenderPassDrawQuad) <= kLargestDrawQuadSize,
+ "Largest Draw Quad size needs update. RenderPassDrawQuad is "
+ "currently largest.");
+ static_assert(sizeof(StreamVideoDrawQuad) <= kLargestDrawQuadSize,
+ "Largest Draw Quad size needs update. StreamVideoDrawQuad is "
+ "currently largest.");
return kLargestDrawQuadSize;
}
« 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