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

Unified Diff: cc/surfaces/surface_aggregator_test_helpers.h

Issue 331533002: Use a struct for cc::Surface ids for more type safety (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add is_null and explicit ctor Created 6 years, 6 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/surfaces/surface_aggregator.cc ('k') | cc/surfaces/surface_aggregator_test_helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator_test_helpers.h
diff --git a/cc/surfaces/surface_aggregator_test_helpers.h b/cc/surfaces/surface_aggregator_test_helpers.h
index fd2c8d3a5bbc5296b662ca0299dcd217b81b22bd..10c56590d795a26bee178ad10f73a65273d50a7e 100644
--- a/cc/surfaces/surface_aggregator_test_helpers.h
+++ b/cc/surfaces/surface_aggregator_test_helpers.h
@@ -7,6 +7,7 @@
#include "cc/quads/draw_quad.h"
#include "cc/quads/render_pass.h"
+#include "cc/surfaces/surface_id.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/size.h"
@@ -25,7 +26,7 @@ struct Quad {
return quad;
}
- static Quad SurfaceQuad(int surface_id) {
+ static Quad SurfaceQuad(SurfaceId surface_id) {
Quad quad;
quad.material = DrawQuad::SURFACE_CONTENT;
quad.surface_id = surface_id;
@@ -41,7 +42,7 @@ struct Quad {
DrawQuad::Material material;
// Set when material==DrawQuad::SURFACE_CONTENT.
- int surface_id;
+ SurfaceId surface_id;
// Set when material==DrawQuad::SOLID_COLOR.
SkColor color;
// Set when material==DrawQuad::RENDER_PASS.
@@ -50,7 +51,6 @@ struct Quad {
private:
Quad()
: material(DrawQuad::INVALID),
- surface_id(-1),
color(SK_ColorWHITE),
render_pass_id(-1, -1) {}
};
« no previous file with comments | « cc/surfaces/surface_aggregator.cc ('k') | cc/surfaces/surface_aggregator_test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698