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

Unified Diff: cc/layers/surface_layer.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: 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
Index: cc/layers/surface_layer.cc
diff --git a/cc/layers/surface_layer.cc b/cc/layers/surface_layer.cc
index 385f158608fd06b6565a5dcf32de4281a464aa32..62ae92b8a57e58675474cbc874731cf5b4f6ce04 100644
--- a/cc/layers/surface_layer.cc
+++ b/cc/layers/surface_layer.cc
@@ -12,11 +12,12 @@ scoped_refptr<SurfaceLayer> SurfaceLayer::Create() {
return make_scoped_refptr(new SurfaceLayer);
}
-SurfaceLayer::SurfaceLayer() : Layer(), surface_id_(0) {}
+SurfaceLayer::SurfaceLayer() : Layer() {
+}
SurfaceLayer::~SurfaceLayer() {}
-void SurfaceLayer::SetSurfaceId(int surface_id) {
+void SurfaceLayer::SetSurfaceId(SurfaceId surface_id) {
surface_id_ = surface_id;
SetNeedsPushProperties();
}
@@ -26,7 +27,7 @@ scoped_ptr<LayerImpl> SurfaceLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
}
bool SurfaceLayer::DrawsContent() const {
- return surface_id_ && Layer::DrawsContent();
+ return surface_id_.id != 0 && Layer::DrawsContent();
piman 2014/06/11 23:48:59 nit: is it worth adding a SurfaceId::is_null()?
}
void SurfaceLayer::PushPropertiesTo(LayerImpl* layer) {

Powered by Google App Engine
This is Rietveld 408576698