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

Unified Diff: cc/quads/surface_draw_quad.cc

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/quads/surface_draw_quad.h ('k') | cc/surfaces/display.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/surface_draw_quad.cc
diff --git a/cc/quads/surface_draw_quad.cc b/cc/quads/surface_draw_quad.cc
index e7d09d5efcaf344636b21e321b26bcdde96b9358..8591261c2dec2446e0e70af9b33e9c1919eea8e7 100644
--- a/cc/quads/surface_draw_quad.cc
+++ b/cc/quads/surface_draw_quad.cc
@@ -9,7 +9,8 @@
namespace cc {
-SurfaceDrawQuad::SurfaceDrawQuad() : surface_id(0) {}
+SurfaceDrawQuad::SurfaceDrawQuad() {
+}
scoped_ptr<SurfaceDrawQuad> SurfaceDrawQuad::Create() {
return make_scoped_ptr(new SurfaceDrawQuad);
@@ -18,7 +19,7 @@ scoped_ptr<SurfaceDrawQuad> SurfaceDrawQuad::Create() {
void SurfaceDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
const gfx::Rect& rect,
const gfx::Rect& visible_rect,
- int surface_id) {
+ SurfaceId surface_id) {
gfx::Rect opaque_rect;
bool needs_blending = false;
DrawQuad::SetAll(shared_quad_state, DrawQuad::SURFACE_CONTENT, rect,
@@ -31,7 +32,7 @@ void SurfaceDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
const gfx::Rect& opaque_rect,
const gfx::Rect& visible_rect,
bool needs_blending,
- int surface_id) {
+ SurfaceId surface_id) {
DrawQuad::SetAll(shared_quad_state, DrawQuad::SURFACE_CONTENT, rect,
opaque_rect, visible_rect, needs_blending);
this->surface_id = surface_id;
@@ -46,7 +47,7 @@ const SurfaceDrawQuad* SurfaceDrawQuad::MaterialCast(const DrawQuad* quad) {
}
void SurfaceDrawQuad::ExtendValue(base::DictionaryValue* value) const {
- value->SetInteger("surface_id", surface_id);
+ value->SetInteger("surface_id", surface_id.id);
}
« no previous file with comments | « cc/quads/surface_draw_quad.h ('k') | cc/surfaces/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698