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

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: 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/layers/surface_layer.h ('k') | cc/layers/surface_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/surface_layer.cc
diff --git a/cc/layers/surface_layer.cc b/cc/layers/surface_layer.cc
index 385f158608fd06b6565a5dcf32de4281a464aa32..f345b7423ddbe58e0665bd8d5740a343ca9ef08e 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_.is_null() && Layer::DrawsContent();
}
void SurfaceLayer::PushPropertiesTo(LayerImpl* layer) {
« no previous file with comments | « cc/layers/surface_layer.h ('k') | cc/layers/surface_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698