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

Side by Side Diff: cc/trees/occlusion_tracker_unittest.cc

Issue 640203002: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr [part-… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format fix. Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/occlusion_tracker.h" 5 #include "cc/trees/occlusion_tracker.h"
6 6
7 #include "cc/animation/layer_animation_controller.h" 7 #include "cc/animation/layer_animation_controller.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/layers/layer_impl.h" 10 #include "cc/layers/layer_impl.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 typedef OcclusionTracker<Layer> OcclusionTrackerType; 117 typedef OcclusionTracker<Layer> OcclusionTrackerType;
118 118
119 static LayerPtrType CreateLayer(HostType* host) { return Layer::Create(); } 119 static LayerPtrType CreateLayer(HostType* host) { return Layer::Create(); }
120 static ContentLayerPtrType CreateContentLayer(HostType* host) { 120 static ContentLayerPtrType CreateContentLayer(HostType* host) {
121 return make_scoped_refptr(new ContentLayerType()); 121 return make_scoped_refptr(new ContentLayerType());
122 } 122 }
123 123
124 template <typename T> 124 template <typename T>
125 static LayerPtrType PassLayerPtr(T* layer) { 125 static LayerPtrType PassLayerPtr(T* layer) {
126 LayerPtrType ref(*layer); 126 LayerPtrType ref(*layer);
127 *layer = NULL; 127 *layer = nullptr;
128 return ref; 128 return ref;
129 } 129 }
130 130
131 static void DestroyLayer(LayerPtrType* layer) { *layer = NULL; } 131 static void DestroyLayer(LayerPtrType* layer) { *layer = nullptr; }
132 132
133 static void RecursiveUpdateNumChildren(LayerType* layerType) {} 133 static void RecursiveUpdateNumChildren(LayerType* layerType) {}
134 }; 134 };
135 135
136 struct OcclusionTrackerTestImplThreadTypes { 136 struct OcclusionTrackerTestImplThreadTypes {
137 typedef LayerImpl LayerType; 137 typedef LayerImpl LayerType;
138 typedef LayerTreeImpl HostType; 138 typedef LayerTreeImpl HostType;
139 typedef RenderSurfaceImpl RenderSurfaceType; 139 typedef RenderSurfaceImpl RenderSurfaceType;
140 typedef TestContentLayerImpl ContentLayerType; 140 typedef TestContentLayerImpl ContentLayerType;
141 typedef scoped_ptr<LayerImpl> LayerPtrType; 141 typedef scoped_ptr<LayerImpl> LayerPtrType;
(...skipping 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after
3301 EXPECT_EQ(gfx::Rect(), 3301 EXPECT_EQ(gfx::Rect(),
3302 occlusion.UnoccludedSurfaceContentRect( 3302 occlusion.UnoccludedSurfaceContentRect(
3303 surface, gfx::Rect(80, 70, 50, 50))); 3303 surface, gfx::Rect(80, 70, 50, 50)));
3304 } 3304 }
3305 }; 3305 };
3306 3306
3307 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) 3307 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery)
3308 3308
3309 } // namespace 3309 } // namespace
3310 } // namespace cc 3310 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698