diff options
55 files changed, 265 insertions, 260 deletions
diff --git a/cc/animation/layer_animation_controller_unittest.cc b/cc/animation/layer_animation_controller_unittest.cc index 4f83766..4907de7 100644 --- a/cc/animation/layer_animation_controller_unittest.cc +++ b/cc/animation/layer_animation_controller_unittest.cc @@ -235,19 +235,19 @@ TEST(LayerAnimationControllerTest, TrivialTransitionOnImpl) { controller_impl->UpdateState(events.get()); EXPECT_TRUE(controller_impl->HasActiveAnimation()); EXPECT_EQ(0.f, dummy_impl.opacity()); - EXPECT_EQ(2u, events->size()); + EXPECT_EQ(2, events->size()); const AnimationEvent* start_opacity_event = GetMostRecentPropertyUpdateEvent(events.get()); - EXPECT_EQ(0.f, start_opacity_event->opacity); + EXPECT_EQ(0, start_opacity_event->opacity); controller_impl->Animate(1.0); controller_impl->UpdateState(events.get()); EXPECT_EQ(1.f, dummy_impl.opacity()); EXPECT_FALSE(controller_impl->HasActiveAnimation()); - EXPECT_EQ(4u, events->size()); + EXPECT_EQ(4, events->size()); const AnimationEvent* end_opacity_event = GetMostRecentPropertyUpdateEvent(events.get()); - EXPECT_EQ(1.f, end_opacity_event->opacity); + EXPECT_EQ(1, end_opacity_event->opacity); } TEST(LayerAnimationControllerTest, TrivialTransformOnImpl) { @@ -284,7 +284,7 @@ TEST(LayerAnimationControllerTest, TrivialTransformOnImpl) { controller_impl->UpdateState(events.get()); EXPECT_TRUE(controller_impl->HasActiveAnimation()); EXPECT_EQ(gfx::Transform(), dummy_impl.transform()); - EXPECT_EQ(2u, events->size()); + EXPECT_EQ(2, events->size()); const AnimationEvent* start_transform_event = GetMostRecentPropertyUpdateEvent(events.get()); ASSERT_TRUE(start_transform_event); @@ -297,7 +297,7 @@ TEST(LayerAnimationControllerTest, TrivialTransformOnImpl) { controller_impl->UpdateState(events.get()); EXPECT_EQ(expected_transform, dummy_impl.transform()); EXPECT_FALSE(controller_impl->HasActiveAnimation()); - EXPECT_EQ(4u, events->size()); + EXPECT_EQ(4, events->size()); const AnimationEvent* end_transform_event = GetMostRecentPropertyUpdateEvent(events.get()); EXPECT_EQ(expected_transform, end_transform_event->transform); @@ -882,7 +882,7 @@ TEST(LayerAnimationControllerTest, SkipUpdateState) { controller->UpdateState(events.get()); // Should have one Started event and one Finished event. - EXPECT_EQ(2u, events->size()); + EXPECT_EQ(2, events->size()); EXPECT_NE((*events)[0].type, (*events)[1].type); // The float transition should still be at its starting point. diff --git a/cc/base/scoped_ptr_hash_map.h b/cc/base/scoped_ptr_hash_map.h index 970984a..3a749a5 100644 --- a/cc/base/scoped_ptr_hash_map.h +++ b/cc/base/scoped_ptr_hash_map.h @@ -117,7 +117,7 @@ class ScopedPtrHashMap { return it->second; } - inline bool contains(const Key& k) const { return data_.count(k) > 0; } + inline bool contains(const Key& k) const { return data_.count(k); } inline void clear() { STLDeleteValues(&data_); } diff --git a/cc/base/tiling_data_unittest.cc b/cc/base/tiling_data_unittest.cc index db2d6f2..ea141ad 100644 --- a/cc/base/tiling_data_unittest.cc +++ b/cc/base/tiling_data_unittest.cc @@ -954,7 +954,7 @@ void TestIterate( } EXPECT_TRUE(found); } - EXPECT_EQ(0u, expected.size()); + EXPECT_EQ(0, expected.size()); } // Make sure this also works with a difference iterator and an empty ignore. @@ -973,7 +973,7 @@ void TestIterate( } EXPECT_TRUE(found); } - EXPECT_EQ(0u, expected.size()); + EXPECT_EQ(0, expected.size()); } } @@ -1078,7 +1078,7 @@ void TestDiff( } EXPECT_TRUE(found); } - EXPECT_EQ(0u, expected.size()); + EXPECT_EQ(0, expected.size()); } TEST(TilingDataTest, DifferenceIteratorIgnoreGeometry) { diff --git a/cc/base/worker_pool.cc b/cc/base/worker_pool.cc index 2c47101..d276529 100644 --- a/cc/base/worker_pool.cc +++ b/cc/base/worker_pool.cc @@ -177,9 +177,7 @@ WorkerPool::Inner::Inner(WorkerPool* worker_pool, new base::DelegateSimpleThread( this, thread_name_prefix + - base::StringPrintf( - "Worker%lu", - static_cast<unsigned long>(workers_.size() + 1)).c_str())); + base::StringPrintf("Worker%lu", workers_.size() + 1).c_str())); worker->Start(); workers_.push_back(worker.Pass()); } @@ -193,9 +191,9 @@ WorkerPool::Inner::~Inner() { // Cancel all pending callbacks. weak_ptr_factory_.InvalidateWeakPtrs(); - DCHECK_EQ(0u, pending_tasks_.size()); - DCHECK_EQ(0u, completed_tasks_.size()); - DCHECK_EQ(0u, running_task_count_); + DCHECK_EQ(pending_tasks_.size(), 0); + DCHECK_EQ(completed_tasks_.size(), 0); + DCHECK_EQ(running_task_count_, 0); } void WorkerPool::Inner::Shutdown() { @@ -432,7 +430,7 @@ WorkerPool::~WorkerPool() { // Cancel all pending callbacks. weak_ptr_factory_.InvalidateWeakPtrs(); - DCHECK_EQ(0u, completed_tasks_.size()); + DCHECK_EQ(completed_tasks_.size(), 0); } void WorkerPool::Shutdown() { @@ -4,7 +4,6 @@ { 'variables': { - 'chromium_code': 1, 'cc_source_files': [ 'animation/animation.cc', 'animation/animation.h', diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp index a32483e..2f790a7 100644 --- a/cc/cc_tests.gyp +++ b/cc/cc_tests.gyp @@ -4,7 +4,7 @@ { 'variables': { - 'chromium_code': 1, + 'chromium_code': 0, 'cc_unit_tests_source_files': [ 'animation/animation_unittest.cc', 'layers/content_layer_unittest.cc', diff --git a/cc/debug/debug_colors.cc b/cc/debug/debug_colors.cc index 0680261..01e72bb 100644 --- a/cc/debug/debug_colors.cc +++ b/cc/debug/debug_colors.cc @@ -8,7 +8,7 @@ namespace cc { -static float Scale(float width, const LayerTreeImpl* tree_impl) { +static const float Scale(float width, const LayerTreeImpl* tree_impl) { return width * (tree_impl ? tree_impl->device_scale_factor() : 1); } diff --git a/cc/debug/layer_tree_debug_state.cc b/cc/debug/layer_tree_debug_state.cc index 9018be0..41b53e3 100644 --- a/cc/debug/layer_tree_debug_state.cc +++ b/cc/debug/layer_tree_debug_state.cc @@ -22,8 +22,8 @@ LayerTreeDebugState::LayerTreeDebugState() show_occluding_rects(false), show_non_occluding_rects(false), slow_down_raster_scale_factor(0), - trace_all_rendered_frames(false), - record_rendering_stats_(false) {} + record_rendering_stats_(false), + trace_all_rendered_frames(false) {} LayerTreeDebugState::~LayerTreeDebugState() {} diff --git a/cc/layers/delegated_renderer_layer_impl.cc b/cc/layers/delegated_renderer_layer_impl.cc index f845013..9ae9e33 100644 --- a/cc/layers/delegated_renderer_layer_impl.cc +++ b/cc/layers/delegated_renderer_layer_impl.cc @@ -117,7 +117,7 @@ void DelegatedRendererLayerImpl::SetFrameData( resource_map.begin(); it != resource_map.end(); ++it) { - bool resource_is_in_current_frame = resources_.count(it->second) > 0; + bool resource_is_in_current_frame = resources_.count(it->second); bool resource_is_in_use = resource_provider->InUseByConsumer(it->second); if (!resource_is_in_current_frame && !resource_is_in_use) unused_resources.push_back(it->second); diff --git a/cc/layers/delegated_renderer_layer_impl_unittest.cc b/cc/layers/delegated_renderer_layer_impl_unittest.cc index a7064d9..bdff25f 100644 --- a/cc/layers/delegated_renderer_layer_impl_unittest.cc +++ b/cc/layers/delegated_renderer_layer_impl_unittest.cc @@ -1021,6 +1021,8 @@ TEST_F(DelegatedRendererLayerImplTestClip, ASSERT_EQ(5u, root_delegated_quad_list.size()); const SharedQuadState* root_delegated_shared_quad_state = root_delegated_quad_list[0]->shared_quad_state; + const SharedQuadState* contrib_delegated_shared_quad_state = + contrib_delegated_quad_list[0]->shared_quad_state; // When the quads don't have a clip of their own, the clip rect is set to // the drawable_content_rect of the delegated renderer layer. @@ -1051,6 +1053,8 @@ TEST_F(DelegatedRendererLayerImplTestClip, ASSERT_EQ(5u, root_delegated_quad_list.size()); const SharedQuadState* root_delegated_shared_quad_state = root_delegated_quad_list[0]->shared_quad_state; + const SharedQuadState* contrib_delegated_shared_quad_state = + contrib_delegated_quad_list[0]->shared_quad_state; // When the quads have a clip of their own, it is used. EXPECT_EQ(gfx::Rect(25, 25, 40, 40).ToString(), @@ -1079,6 +1083,8 @@ TEST_F(DelegatedRendererLayerImplTestClip, ASSERT_EQ(5u, root_delegated_quad_list.size()); const SharedQuadState* root_delegated_shared_quad_state = root_delegated_quad_list[0]->shared_quad_state; + const SharedQuadState* contrib_delegated_shared_quad_state = + contrib_delegated_quad_list[0]->shared_quad_state; // When the quads don't have a clip of their own, the clip rect is set to // the drawable_content_rect of the delegated renderer layer. When the layer @@ -1109,6 +1115,8 @@ TEST_F(DelegatedRendererLayerImplTestClip, ASSERT_EQ(5u, root_delegated_quad_list.size()); const SharedQuadState* root_delegated_shared_quad_state = root_delegated_quad_list[0]->shared_quad_state; + const SharedQuadState* contrib_delegated_shared_quad_state = + contrib_delegated_quad_list[0]->shared_quad_state; // When the quads have a clip of their own, it is used, but it is // combined with the clip rect of the delegated renderer layer. @@ -1140,6 +1148,8 @@ TEST_F(DelegatedRendererLayerImplTestClip, ASSERT_EQ(5u, root_delegated_quad_list.size()); const SharedQuadState* root_delegated_shared_quad_state = root_delegated_quad_list[0]->shared_quad_state; + const SharedQuadState* contrib_delegated_shared_quad_state = + contrib_delegated_quad_list[0]->shared_quad_state; // When the layer owns a surface, the quads don't need to be clipped // further than they already specify. If they aren't clipped, then their @@ -1169,6 +1179,8 @@ TEST_F(DelegatedRendererLayerImplTestClip, ASSERT_EQ(5u, root_delegated_quad_list.size()); const SharedQuadState* root_delegated_shared_quad_state = root_delegated_quad_list[0]->shared_quad_state; + const SharedQuadState* contrib_delegated_shared_quad_state = + contrib_delegated_quad_list[0]->shared_quad_state; // When the quads have a clip of their own, it is used. EXPECT_EQ(gfx::Rect(5, 5, 40, 40).ToString(), @@ -1199,6 +1211,8 @@ TEST_F(DelegatedRendererLayerImplTestClip, ASSERT_EQ(5u, root_delegated_quad_list.size()); const SharedQuadState* root_delegated_shared_quad_state = root_delegated_quad_list[0]->shared_quad_state; + const SharedQuadState* contrib_delegated_shared_quad_state = + contrib_delegated_quad_list[0]->shared_quad_state; // When the layer owns a surface, the quads don't need to be clipped // further than they already specify. If they aren't clipped, then their @@ -1227,6 +1241,8 @@ TEST_F(DelegatedRendererLayerImplTestClip, QuadsClipped_LayerClipped_Surface) { ASSERT_EQ(5u, root_delegated_quad_list.size()); const SharedQuadState* root_delegated_shared_quad_state = root_delegated_quad_list[0]->shared_quad_state; + const SharedQuadState* contrib_delegated_shared_quad_state = + contrib_delegated_quad_list[0]->shared_quad_state; // When the quads have a clip of their own, it is used, but it is // combined with the clip rect of the delegated renderer layer. If the diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc index 4ff96a5..5c99e2e 100644 --- a/cc/layers/heads_up_display_layer_impl.cc +++ b/cc/layers/heads_up_display_layer_impl.cc @@ -69,10 +69,10 @@ double HeadsUpDisplayLayerImpl::Graph::UpdateUpperBound() { HeadsUpDisplayLayerImpl::HeadsUpDisplayLayerImpl(LayerTreeImpl* tree_impl, int id) : LayerImpl(tree_impl, id), - typeface_(skia::AdoptRef( - SkTypeface::CreateFromName("monospace", SkTypeface::kBold))), fps_graph_(60.0, 80.0), - paint_time_graph_(16.0, 48.0) {} + paint_time_graph_(16.0, 48.0), + typeface_(skia::AdoptRef( + SkTypeface::CreateFromName("monospace", SkTypeface::kBold))) {} HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() {} diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc index e181e3a..5bbf4e2 100644 --- a/cc/layers/layer_impl_unittest.cc +++ b/cc/layers/layer_impl_unittest.cc @@ -139,8 +139,7 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) { EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED( root->SetContentsScale(arbitrary_number, arbitrary_number)); EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetDrawsContent(true)); - EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED( - root->SetBackgroundColor(arbitrary_color)); + EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetBackgroundColor(SK_ColorGRAY)); EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED( root->SetBackgroundFilters(arbitrary_filters)); @@ -262,8 +261,7 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) { VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( root->SetContentsScale(arbitrary_number, arbitrary_number)); VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(root->SetDrawsContent(true)); - VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( - root->SetBackgroundColor(arbitrary_color)); + VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(root->SetBackgroundColor(SK_ColorGRAY)); VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( root->SetBackgroundFilters(arbitrary_filters)); VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(root->SetOpacity(arbitrary_number)); @@ -290,7 +288,7 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) { root->SetContentsScale(arbitrary_number, arbitrary_number)); VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(root->SetDrawsContent(true)); VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( - root->SetBackgroundColor(arbitrary_color)); + root->SetBackgroundColor(SK_ColorGRAY)); VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( root->SetBackgroundFilters(arbitrary_filters)); VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(root->SetOpacity(arbitrary_number)); diff --git a/cc/layers/nine_patch_layer_impl_unittest.cc b/cc/layers/nine_patch_layer_impl_unittest.cc index 1985bd4..740fa50 100644 --- a/cc/layers/nine_patch_layer_impl_unittest.cc +++ b/cc/layers/nine_patch_layer_impl_unittest.cc @@ -63,7 +63,7 @@ TEST(NinePatchLayerImplTest, VerifyDrawQuads) { // Verify quad rects const QuadList& quads = quad_culler.quad_list(); - EXPECT_EQ(8u, quads.size()); + EXPECT_EQ(8, quads.size()); Region remaining(visible_content_rect); for (size_t i = 0; i < quads.size(); ++i) { DrawQuad* quad = quads[i]; @@ -119,7 +119,7 @@ TEST(NinePatchLayerImplTest, VerifyDrawQuadsForSqueezedLayer) { // Verify corner rects fill the layer and don't overlap const QuadList& quads = quad_culler.quad_list(); - EXPECT_EQ(4u, quads.size()); + EXPECT_EQ(4, quads.size()); Region filled; for (size_t i = 0; i < quads.size(); ++i) { DrawQuad* quad = quads[i]; diff --git a/cc/layers/nine_patch_layer_unittest.cc b/cc/layers/nine_patch_layer_unittest.cc index 2f792a7..a274100 100644 --- a/cc/layers/nine_patch_layer_unittest.cc +++ b/cc/layers/nine_patch_layer_unittest.cc @@ -74,8 +74,8 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) { // No bitmap set should not trigger any uploads. test_layer->SetTexturePriorities(calculator); test_layer->Update(&queue, &occlusion_tracker, NULL); - EXPECT_EQ(0u, queue.FullUploadSize()); - EXPECT_EQ(0u, queue.PartialUploadSize()); + EXPECT_EQ(queue.FullUploadSize(), 0); + EXPECT_EQ(queue.PartialUploadSize(), 0); // Setting a bitmap set should trigger a single full upload. SkBitmap bitmap; @@ -84,8 +84,8 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) { test_layer->SetBitmap(bitmap, gfx::Rect(5, 5, 1, 1)); test_layer->SetTexturePriorities(calculator); test_layer->Update(&queue, &occlusion_tracker, NULL); - EXPECT_EQ(1u, queue.FullUploadSize()); - EXPECT_EQ(0u, queue.PartialUploadSize()); + EXPECT_EQ(queue.FullUploadSize(), 1); + EXPECT_EQ(queue.PartialUploadSize(), 0); ResourceUpdate params = queue.TakeFirstFullUpload(); EXPECT_TRUE(params.texture != NULL); @@ -108,8 +108,8 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) { // Nothing changed, so no repeated upload. test_layer->SetTexturePriorities(calculator); test_layer->Update(&queue, &occlusion_tracker, NULL); - EXPECT_EQ(0u, queue.FullUploadSize()); - EXPECT_EQ(0u, queue.PartialUploadSize()); + EXPECT_EQ(queue.FullUploadSize(), 0); + EXPECT_EQ(queue.PartialUploadSize(), 0); { DebugScopedSetImplThread impl_thread(Proxy()); DebugScopedSetMainThreadBlocked main_thread_blocked(Proxy()); @@ -120,8 +120,8 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) { // Reupload after eviction test_layer->SetTexturePriorities(calculator); test_layer->Update(&queue, &occlusion_tracker, NULL); - EXPECT_EQ(1u, queue.FullUploadSize()); - EXPECT_EQ(0u, queue.PartialUploadSize()); + EXPECT_EQ(queue.FullUploadSize(), 1); + EXPECT_EQ(queue.PartialUploadSize(), 0); // PrioritizedResourceManager clearing layer_tree_host_->contents_texture_manager()->UnregisterTexture( @@ -130,8 +130,8 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) { test_layer->SetTexturePriorities(calculator); ResourceUpdateQueue queue2; test_layer->Update(&queue2, &occlusion_tracker, NULL); - EXPECT_EQ(1u, queue2.FullUploadSize()); - EXPECT_EQ(0u, queue2.PartialUploadSize()); + EXPECT_EQ(queue2.FullUploadSize(), 1); + EXPECT_EQ(queue2.PartialUploadSize(), 0); params = queue2.TakeFirstFullUpload(); EXPECT_TRUE(params.texture != NULL); EXPECT_EQ(params.texture->resource_manager(), diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index b3ce6bd..83a6fd4 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc @@ -233,7 +233,7 @@ class PictureLayerImplTest : public testing::Test { // Add 1x1 rects at the centers of each tile, then re-record pile contents std::vector<Tile*> tiles = active_layer_->tilings().tiling_at(0)->AllTilesForTesting(); - EXPECT_EQ(16u, tiles.size()); + EXPECT_EQ(16, tiles.size()); std::vector<SkRect> rects; std::vector<Tile*>::const_iterator tile_iter; for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) { @@ -261,7 +261,7 @@ class PictureLayerImplTest : public testing::Test { // SkPicture is perfectly aligned with the compositor's tiles. // Note: There are two rects: the initial clear and the explicitly // recorded rect. We only care about the second one. - EXPECT_EQ(2u, mock_canvas.rects_.size()); + EXPECT_EQ(2, mock_canvas.rects_.size()); EXPECT_EQ(*rect_iter, mock_canvas.rects_[1]); rect_iter++; } diff --git a/cc/layers/scrollbar_layer_impl.h b/cc/layers/scrollbar_layer_impl.h index 4a1da30..bf1cbe8 100644 --- a/cc/layers/scrollbar_layer_impl.h +++ b/cc/layers/scrollbar_layer_impl.h @@ -45,7 +45,7 @@ class CC_EXPORT ScrollbarLayerImpl : public ScrollbarLayerImplBase { void set_thumb_resource_id(ResourceProvider::ResourceId id) { thumb_resource_id_ = id; } - bool HasThumbTexture() { return thumb_resource_id_ != 0; } + bool HasThumbTexture() { return thumb_resource_id_; } // ScrollbarLayerImplBase implementation. diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc index d1870b3..779abf1 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -206,7 +206,7 @@ TEST(ScrollbarLayerTest, SolidColorDrawQuads) { scrollbar_layer_impl->AppendQuads(&quad_culler, &data); const QuadList& quads = quad_culler.quad_list(); - ASSERT_EQ(1u, quads.size()); + ASSERT_EQ(1, quads.size()); EXPECT_EQ(DrawQuad::SOLID_COLOR, quads[0]->material); EXPECT_RECT_EQ(gfx::Rect(1, 0, 4, 3), quads[0]->rect); } @@ -220,7 +220,7 @@ TEST(ScrollbarLayerTest, SolidColorDrawQuads) { scrollbar_layer_impl->AppendQuads(&quad_culler, &data); const QuadList& quads = quad_culler.quad_list(); - ASSERT_EQ(1u, quads.size()); + ASSERT_EQ(1, quads.size()); EXPECT_EQ(DrawQuad::SOLID_COLOR, quads[0]->material); EXPECT_RECT_EQ(gfx::Rect(2, 0, 8, 6), quads[0]->rect); } @@ -238,7 +238,7 @@ TEST(ScrollbarLayerTest, SolidColorDrawQuads) { scrollbar_layer_impl->AppendQuads(&quad_culler, &data); const QuadList& quads = quad_culler.quad_list(); - ASSERT_EQ(1u, quads.size()); + ASSERT_EQ(1, quads.size()); EXPECT_EQ(DrawQuad::SOLID_COLOR, quads[0]->material); EXPECT_RECT_EQ(gfx::Rect(4, 0, 2, 3), quads[0]->rect); } @@ -270,7 +270,7 @@ TEST(ScrollbarLayerTest, LayerDrivenSolidColorDrawQuads) { scrollbar_layer_impl->AppendQuads(&quad_culler, &data); const QuadList& quads = quad_culler.quad_list(); - ASSERT_EQ(1u, quads.size()); + ASSERT_EQ(1, quads.size()); EXPECT_EQ(DrawQuad::SOLID_COLOR, quads[0]->material); EXPECT_RECT_EQ(gfx::Rect(4, 0, 2, 3), quads[0]->rect); } @@ -350,7 +350,7 @@ class ScrollbarLayerTestResourceCreation : public testing::Test { ScrollbarLayerTestResourceCreation() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} - void TestResourceUpload(size_t expected_resources) { + void TestResourceUpload(int expected_resources) { layer_tree_host_.reset( new MockLayerTreeHost(&fake_client_, layer_tree_settings_)); @@ -393,7 +393,7 @@ class ScrollbarLayerTestResourceCreation : public testing::Test { scrollbar_layer->SetTexturePriorities(calculator); layer_tree_host_->contents_texture_manager()->PrioritizeTextures(); scrollbar_layer->Update(&queue, &occlusion_tracker, NULL); - EXPECT_EQ(0u, queue.FullUploadSize()); + EXPECT_EQ(0, queue.FullUploadSize()); EXPECT_EQ(expected_resources, queue.PartialUploadSize()); testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get()); diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc index 078b1f6..eb62c0d 100644 --- a/cc/layers/texture_layer.cc +++ b/cc/layers/texture_layer.cc @@ -44,8 +44,8 @@ TextureLayer::TextureLayer(TextureLayerClient* client, bool uses_mailbox) premultiplied_alpha_(true), rate_limit_context_(false), context_lost_(false), - content_committed_(false), texture_id_(0), + content_committed_(false), own_mailbox_(false) { vertex_opacity_[0] = 1.0f; vertex_opacity_[1] = 1.0f; diff --git a/cc/layers/tiled_layer_impl.cc b/cc/layers/tiled_layer_impl.cc index 2ebad54..e493d36 100644 --- a/cc/layers/tiled_layer_impl.cc +++ b/cc/layers/tiled_layer_impl.cc @@ -78,7 +78,7 @@ void TiledLayerImpl::DumpLayerProperties(std::string* str, int indent) const { } bool TiledLayerImpl::HasTileAt(int i, int j) const { - return !!tiler_->TileAt(i, j); + return tiler_->TileAt(i, j); } bool TiledLayerImpl::HasResourceIdForTileAt(int i, int j) const { diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc index 650f1cb..dab98f56 100644 --- a/cc/layers/tiled_layer_unittest.cc +++ b/cc/layers/tiled_layer_unittest.cc @@ -578,9 +578,8 @@ TEST_F(TiledLayerTest, PaintSmallAnimatedLayersImmediately) { int layer_width = 5 * FakeTiledLayer::tile_size().width(); int layer_height = 5 * FakeTiledLayer::tile_size().height(); int memory_for_layer = layer_width * layer_height * 4; - layer_tree_host_->SetViewportSize( - gfx::Size(viewport_width, viewport_height), - gfx::Size(viewport_width, viewport_height)); + layer_tree_host_->SetViewportSize(gfx::Size(layer_width, layer_height), + gfx::Size(layer_width, layer_height)); // Use 10x5 tiles to run out of memory. if (run_out_of_memory[i]) @@ -959,8 +958,8 @@ TEST_F(TiledLayerPartialUpdateTest, PartialUpdates) { { scoped_ptr<FakeTiledLayerImpl> layer_impl = make_scoped_ptr(new FakeTiledLayerImpl(host_impl_->active_tree(), 1)); - EXPECT_EQ(6u, queue_->FullUploadSize()); - EXPECT_EQ(0u, queue_->PartialUploadSize()); + EXPECT_EQ(6, queue_->FullUploadSize()); + EXPECT_EQ(0, queue_->PartialUploadSize()); UpdateTextures(); EXPECT_EQ(6, layer->fake_layer_updater()->update_count()); EXPECT_FALSE(queue_->HasMoreUpdates()); @@ -976,8 +975,8 @@ TEST_F(TiledLayerPartialUpdateTest, PartialUpdates) { { scoped_ptr<FakeTiledLayerImpl> layer_impl = make_scoped_ptr(new FakeTiledLayerImpl(host_impl_->active_tree(), 1)); - EXPECT_EQ(3u, queue_->FullUploadSize()); - EXPECT_EQ(3u, queue_->PartialUploadSize()); + EXPECT_EQ(3, queue_->FullUploadSize()); + EXPECT_EQ(3, queue_->PartialUploadSize()); UpdateTextures(); EXPECT_EQ(6, layer->fake_layer_updater()->update_count()); EXPECT_FALSE(queue_->HasMoreUpdates()); @@ -993,8 +992,8 @@ TEST_F(TiledLayerPartialUpdateTest, PartialUpdates) { make_scoped_ptr(new FakeTiledLayerImpl(host_impl_->active_tree(), 1)); layer_tree_host_->UpdateLayers(queue_.get(), std::numeric_limits<size_t>::max()); - EXPECT_EQ(2u, queue_->FullUploadSize()); - EXPECT_EQ(4u, queue_->PartialUploadSize()); + EXPECT_EQ(2, queue_->FullUploadSize()); + EXPECT_EQ(4, queue_->PartialUploadSize()); UpdateTextures(); EXPECT_EQ(6, layer->fake_layer_updater()->update_count()); EXPECT_FALSE(queue_->HasMoreUpdates()); @@ -1019,8 +1018,8 @@ TEST_F(TiledLayerPartialUpdateTest, PartialUpdates) { make_scoped_ptr(new FakeTiledLayerImpl(host_impl_->active_tree(), 1)); layer_tree_host_->UpdateLayers(queue_.get(), std::numeric_limits<size_t>::max()); - EXPECT_EQ(6u, queue_->FullUploadSize()); - EXPECT_EQ(0u, queue_->PartialUploadSize()); + EXPECT_EQ(6, queue_->FullUploadSize()); + EXPECT_EQ(0, queue_->PartialUploadSize()); UpdateTextures(); EXPECT_EQ(6, layer->fake_layer_updater()->update_count()); EXPECT_FALSE(queue_->HasMoreUpdates()); @@ -1036,8 +1035,8 @@ TEST_F(TiledLayerPartialUpdateTest, PartialUpdates) { make_scoped_ptr(new FakeTiledLayerImpl(host_impl_->active_tree(), 1)); layer_tree_host_->UpdateLayers(queue_.get(), std::numeric_limits<size_t>::max()); - EXPECT_EQ(0u, queue_->FullUploadSize()); - EXPECT_EQ(4u, queue_->PartialUploadSize()); + EXPECT_EQ(0, queue_->FullUploadSize()); + EXPECT_EQ(4, queue_->PartialUploadSize()); UpdateTextures(); EXPECT_EQ(4, layer->fake_layer_updater()->update_count()); EXPECT_FALSE(queue_->HasMoreUpdates()); diff --git a/cc/layers/video_layer_impl.cc b/cc/layers/video_layer_impl.cc index f87cacc..a0bfda1 100644 --- a/cc/layers/video_layer_impl.cc +++ b/cc/layers/video_layer_impl.cc @@ -354,7 +354,7 @@ bool VideoLayerImpl::FramePlane::AllocateData( resource_id = resource_provider->CreateResource( size, format, ResourceProvider::TextureUsageAny); - return resource_id != 0; + return resource_id; } void VideoLayerImpl::FramePlane::FreeData(ResourceProvider* resource_provider) { @@ -431,7 +431,7 @@ bool VideoLayerImpl::SetupFramePlanes(ResourceProvider* resource_provider) { for (size_t plane_index = 0; plane_index < plane_count; ++plane_index) { const VideoLayerImpl::FramePlane& plane = frame_planes_[plane_index]; // Only planar formats planes should need upload. - DCHECK_EQ(plane.format, static_cast<unsigned>(GL_LUMINANCE)); + DCHECK_EQ(plane.format, GL_LUMINANCE); const uint8_t* software_plane_pixels = frame_->data(plane_index); gfx::Rect image_rect(0, 0, diff --git a/cc/output/delegating_renderer.cc b/cc/output/delegating_renderer.cc index a1763e3..997b699 100644 --- a/cc/output/delegating_renderer.cc +++ b/cc/output/delegating_renderer.cc @@ -85,6 +85,7 @@ bool DelegatingRenderer::Initialize() { bool has_set_visibility = true; bool has_io_surface = true; bool has_arb_texture_rect = true; + bool has_gpu_memory_manager = true; bool has_egl_image = true; for (size_t i = 0; i < extensions.size(); ++i) { if (extensions[i] == "GL_EXT_read_format_bgra") @@ -95,6 +96,8 @@ bool DelegatingRenderer::Initialize() { has_io_surface = true; else if (extensions[i] == "GL_ARB_texture_rectangle") has_arb_texture_rect = true; + else if (extensions[i] == "GL_CHROMIUM_gpu_memory_manager") + has_gpu_memory_manager = true; else if (extensions[i] == "GL_OES_EGL_image_external") has_egl_image = true; } diff --git a/cc/output/geometry_binding.cc b/cc/output/geometry_binding.cc index f1092ce..20bd666 100644 --- a/cc/output/geometry_binding.cc +++ b/cc/output/geometry_binding.cc @@ -16,6 +16,14 @@ GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, : context_(context), quad_vertices_vbo_(0), quad_elements_vbo_(0) { + float vertices[] = { + quad_vertex_rect.x(), quad_vertex_rect.bottom(), 0.0f, 0.0f, + 1.0f, quad_vertex_rect.x(), quad_vertex_rect.y(), 0.0f, + 0.0f, 0.0f, quad_vertex_rect.right(), quad_vertex_rect.y(), + 0.0f, 1.0f, 0.0f, quad_vertex_rect.right(), + quad_vertex_rect.bottom(), 0.0f, 1.0f, 1.0f + }; + struct Vertex { float a_position[3]; float a_texCoord[2]; @@ -39,28 +47,18 @@ GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, Quad quad_list[8]; QuadIndex quad_index_list[8]; for (int i = 0; i < 8; i++) { - Vertex v0 = { { quad_vertex_rect.x(), quad_vertex_rect.bottom(), 0.0f, }, - { 0.0f, 1.0f, }, - i * 4.0f + 0.0f }; - Vertex v1 = { { quad_vertex_rect.x(), quad_vertex_rect.y(), 0.0f, }, - { 0.0f, 0.0f, }, + Vertex v0 = { quad_vertex_rect.x(), quad_vertex_rect.bottom(), 0.0f, 0.0f, + 1.0f, i * 4.0f + 0.0f }; + Vertex v1 = { quad_vertex_rect.x(), quad_vertex_rect.y(), 0.0f, 0.0f, 0.0f, i * 4.0f + 1.0f }; - Vertex v2 = { { quad_vertex_rect.right(), quad_vertex_rect.y(), 0.0f, }, - { 1.0f, .0f, }, - i * 4.0f + 2.0f }; - Vertex v3 = { { quad_vertex_rect.right(), - quad_vertex_rect.bottom(), - 0.0f, }, - { 1.0f, 1.0f, }, - i * 4.0f + 3.0f }; + Vertex v2 = { quad_vertex_rect.right(), quad_vertex_rect.y(), 0.0f, 1.0f, + 0.0f, i * 4.0f + 2.0f }; + Vertex v3 = { quad_vertex_rect.right(), quad_vertex_rect.bottom(), 0.0f, + 1.0f, 1.0f, i * 4.0f + 3.0f }; Quad x = { v0, v1, v2, v3 }; quad_list[i] = x; - QuadIndex y = { { 0 + 4 * i, - 1 + 4 * i, - 2 + 4 * i, - 3 + 4 * i, - 0 + 4 * i, - 2 + 4 * i } }; + QuadIndex y = { 0 + 4 * i, 1 + 4 * i, 2 + 4 * i, 3 + 4 * i, 0 + 4 * i, + 2 + 4 * i }; quad_index_list[i] = y; } diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 6d35914..4eac4cd 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -140,24 +140,23 @@ bool GLRenderer::Initialize() { // Use the SwapBuffers callback only with the threaded proxy. if (client_->HasImplThread()) capabilities_.using_swap_complete_callback = - extensions.count("GL_CHROMIUM_swapbuffers_complete_callback") > 0; + extensions.count("GL_CHROMIUM_swapbuffers_complete_callback"); if (capabilities_.using_swap_complete_callback) context_->setSwapBuffersCompleteCallbackCHROMIUM(this); capabilities_.using_set_visibility = - extensions.count("GL_CHROMIUM_set_visibility") > 0; + extensions.count("GL_CHROMIUM_set_visibility"); - if (extensions.count("GL_CHROMIUM_iosurface") > 0) - DCHECK(extensions.count("GL_ARB_texture_rectangle") > 0); + if (extensions.count("GL_CHROMIUM_iosurface")) + DCHECK(extensions.count("GL_ARB_texture_rectangle")); capabilities_.using_gpu_memory_manager = - extensions.count("GL_CHROMIUM_gpu_memory_manager") > 0 && + extensions.count("GL_CHROMIUM_gpu_memory_manager") && Settings().use_memory_management; if (capabilities_.using_gpu_memory_manager) context_->setMemoryAllocationChangedCallbackCHROMIUM(this); - capabilities_.using_egl_image = - extensions.count("GL_OES_EGL_image_external") > 0; + capabilities_.using_egl_image = extensions.count("GL_OES_EGL_image_external"); capabilities_.max_texture_size = resource_provider_->max_texture_size(); capabilities_.best_texture_format = resource_provider_->best_texture_format(); @@ -168,12 +167,12 @@ bool GLRenderer::Initialize() { // Check for texture fast paths. Currently we always use MO8 textures, // so we only need to avoid POT textures if we have an NPOT fast-path. capabilities_.avoid_pow2_textures = - extensions.count("GL_CHROMIUM_fast_NPOT_MO8_textures") > 0; + extensions.count("GL_CHROMIUM_fast_NPOT_MO8_textures"); capabilities_.using_offscreen_context3d = true; is_using_bind_uniform_ = - extensions.count("GL_CHROMIUM_bind_uniform_location") > 0; + extensions.count("GL_CHROMIUM_bind_uniform_location"); // Make sure scissoring starts as disabled. GLC(context_, context_->disable(GL_SCISSOR_TEST)); diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc index bf41c53..673e7cc 100644 --- a/cc/output/gl_renderer_unittest.cc +++ b/cc/output/gl_renderer_unittest.cc @@ -861,7 +861,7 @@ TEST(GLRendererTest2, ActiveTextureState) { cc::DirectRenderer::DrawingFrame drawing_frame; renderer.BeginDrawingFrame(&drawing_frame); - EXPECT_EQ(static_cast<unsigned>(GL_TEXTURE0), context->active_texture()); + EXPECT_EQ(context->active_texture(), GL_TEXTURE0); for (cc::QuadList::BackToFrontIterator it = pass->quad_list.BackToFrontBegin(); @@ -870,7 +870,7 @@ TEST(GLRendererTest2, ActiveTextureState) { renderer.DoDrawQuad(&drawing_frame, *it); } renderer.FinishDrawingQuadList(); - EXPECT_EQ(static_cast<unsigned>(GL_TEXTURE0), context->active_texture()); + EXPECT_EQ(context->active_texture(), GL_TEXTURE0); Mock::VerifyAndClearExpectations(context); } diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc index 534b46d..9abb7f5 100644 --- a/cc/output/output_surface.cc +++ b/cc/output/output_surface.cc @@ -64,7 +64,7 @@ bool OutputSurface::BindToClient( set<string> extensions(extensions_list.begin(), extensions_list.end()); has_gl_discard_backbuffer_ = - extensions.count("GL_CHROMIUM_discard_backbuffer") > 0; + extensions.count("GL_CHROMIUM_discard_backbuffer"); return true; } diff --git a/cc/output/software_renderer_unittest.cc b/cc/output/software_renderer_unittest.cc index ade2b90..bdef48f 100644 --- a/cc/output/software_renderer_unittest.cc +++ b/cc/output/software_renderer_unittest.cc @@ -81,9 +81,7 @@ class SoftwareRendererTest : public testing::Test, public RendererClient { TEST_F(SoftwareRendererTest, SolidColorQuad) { gfx::Size outer_size(100, 100); -#if !defined(OS_ANDROID) int outer_pixels = outer_size.width() * outer_size.height(); -#endif gfx::Size inner_size(98, 98); gfx::Rect outer_rect(outer_size); gfx::Rect inner_rect(gfx::Point(1, 1), inner_size); diff --git a/cc/quads/draw_quad_unittest.cc b/cc/quads/draw_quad_unittest.cc index 7177e6b..043a785 100644 --- a/cc/quads/draw_quad_unittest.cc +++ b/cc/quads/draw_quad_unittest.cc @@ -7,7 +7,6 @@ #include <algorithm> #include "base/bind.h" -#include "base/compiler_specific.h" #include "cc/base/math_util.h" #include "cc/quads/checkerboard_draw_quad.h" #include "cc/quads/debug_border_draw_quad.h" @@ -89,13 +88,13 @@ void CompareDrawQuad(DrawQuad* quad, #define QUAD_DATA \ gfx::Rect quad_rect(30, 40, 50, 60); \ gfx::Rect quad_visible_rect(40, 50, 30, 20); \ - gfx::Rect ALLOW_UNUSED quad_opaque_rect(60, 55, 10, 10); \ - bool ALLOW_UNUSED needs_blending = true; + gfx::Rect quad_opaque_rect(60, 55, 10, 10); \ + bool needs_blending = true; #define SETUP_AND_COPY_QUAD_NEW(Type, quad) \ scoped_ptr<DrawQuad> copy_new(quad_new->Copy(copy_shared_state.get())); \ CompareDrawQuad(quad_new.get(), copy_new.get(), copy_shared_state.get()); \ - const Type* ALLOW_UNUSED copy_quad = Type::MaterialCast(copy_new.get()); + const Type* copy_quad = Type::MaterialCast(copy_new.get()); #define SETUP_AND_COPY_QUAD_ALL(Type, quad) \ scoped_ptr<DrawQuad> copy_all(quad_all->Copy(copy_shared_state.get())); \ @@ -105,7 +104,7 @@ void CompareDrawQuad(DrawQuad* quad, #define SETUP_AND_COPY_QUAD_NEW_1(Type, quad, a) \ scoped_ptr<DrawQuad> copy_new(quad_new->Copy(copy_shared_state.get(), a)); \ CompareDrawQuad(quad_new.get(), copy_new.get(), copy_shared_state.get()); \ - const Type* ALLOW_UNUSED copy_quad = Type::MaterialCast(copy_new.get()); + const Type* copy_quad = Type::MaterialCast(copy_new.get()); #define SETUP_AND_COPY_QUAD_ALL_1(Type, quad, a) \ scoped_ptr<DrawQuad> copy_all(quad_all->Copy(copy_shared_state.get(), a)); \ @@ -662,6 +661,7 @@ TEST(DrawQuadTest, CopyYUVVideoDrawQuad) { TEST(DrawQuadTest, CopyPictureDrawQuad) { gfx::Rect opaque_rect(33, 44, 22, 33); + unsigned resource_id = 104; gfx::RectF tex_coord_rect(31.f, 12.f, 54.f, 20.f); gfx::Size texture_size(85, 32); bool swizzle_contents = true; @@ -874,6 +874,7 @@ TEST_F(DrawQuadIteratorTest, YUVVideoDrawQuad) { TEST_F(DrawQuadIteratorTest, PictureDrawQuad) { gfx::Rect opaque_rect(33, 44, 22, 33); + unsigned resource_id = 104; gfx::RectF tex_coord_rect(31.f, 12.f, 54.f, 20.f); gfx::Size texture_size(85, 32); bool swizzle_contents = true; diff --git a/cc/resources/picture_layer_tiling_set.cc b/cc/resources/picture_layer_tiling_set.cc index b5460b9..f3c73c2 100644 --- a/cc/resources/picture_layer_tiling_set.cc +++ b/cc/resources/picture_layer_tiling_set.cc @@ -4,8 +4,6 @@ #include "cc/resources/picture_layer_tiling_set.h" -#include <limits> - namespace cc { namespace { @@ -135,11 +133,7 @@ PictureLayerTilingSet::CoverageIterator::CoverageIterator( } } - DCHECK_LE(set_->tilings_.size(), - static_cast<size_t>(std::numeric_limits<int>::max())); - - int num_tilings = set_->tilings_.size(); - if (ideal_tiling_ == num_tilings && ideal_tiling_ > 0) + if (ideal_tiling_ == set_->tilings_.size() && ideal_tiling_ > 0) ideal_tiling_--; ++(*this); diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc index a45dd9e..85a2e9b 100644 --- a/cc/resources/picture_pile.cc +++ b/cc/resources/picture_pile.cc @@ -13,7 +13,7 @@ namespace { // Maximum number of pictures that can overlap before we collapse them into // a larger one. -const size_t kMaxOverlapping = 2; +const int kMaxOverlapping = 2; // Maximum percentage area of the base picture another picture in the picture // list can be. If higher, we destroy the list and recreate from scratch. const float kResetThreshold = 0.7f; diff --git a/cc/resources/prioritized_resource.cc b/cc/resources/prioritized_resource.cc index fdc20c3..f5ebf94 100644 --- a/cc/resources/prioritized_resource.cc +++ b/cc/resources/prioritized_resource.cc @@ -165,8 +165,7 @@ bool PrioritizedResource::Backing::CanBeRecycled() const { } void PrioritizedResource::Backing::UpdatePriority() { - DCHECK(!proxy() || - (proxy()->IsImplThread() && proxy()->IsMainThreadBlocked())); + DCHECK(!proxy() || proxy()->IsImplThread() && proxy()->IsMainThreadBlocked()); if (owner_) { priority_at_last_priority_update_ = owner_->request_priority(); was_above_priority_cutoff_at_last_priority_update_ = @@ -178,8 +177,7 @@ void PrioritizedResource::Backing::UpdatePriority() { } void PrioritizedResource::Backing::UpdateInDrawingImplTree() { - DCHECK(!proxy() || - (proxy()->IsImplThread() && proxy()->IsMainThreadBlocked())); + DCHECK(!proxy() || proxy()->IsImplThread() && proxy()->IsMainThreadBlocked()); in_drawing_impl_tree_ = !!owner(); if (!in_drawing_impl_tree_) { DCHECK_EQ(priority_at_last_priority_update_, diff --git a/cc/resources/prioritized_resource_manager.cc b/cc/resources/prioritized_resource_manager.cc index 1a4bea3..970336d 100644 --- a/cc/resources/prioritized_resource_manager.cc +++ b/cc/resources/prioritized_resource_manager.cc @@ -15,13 +15,13 @@ namespace cc { PrioritizedResourceManager::PrioritizedResourceManager(const Proxy* proxy) - : max_memory_limit_bytes_(DefaultMemoryAllocationLimit()), + : proxy_(proxy), + max_memory_limit_bytes_(DefaultMemoryAllocationLimit()), external_priority_cutoff_(PriorityCalculator::AllowEverythingCutoff()), memory_use_bytes_(0), + max_memory_needed_bytes_(0), memory_above_cutoff_bytes_(0), - max_memory_needed_bytes_(0), memory_available_bytes_(0), - proxy_(proxy), backings_tail_not_sorted_(false), memory_visible_bytes_(0), memory_visible_and_nearby_bytes_(0), diff --git a/cc/resources/prioritized_resource_unittest.cc b/cc/resources/prioritized_resource_unittest.cc index b820933..1c8de7e 100644 --- a/cc/resources/prioritized_resource_unittest.cc +++ b/cc/resources/prioritized_resource_unittest.cc @@ -262,10 +262,10 @@ TEST_F(PrioritizedResourceTest, ChangePriorityCutoff) { impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ReduceMemoryOnImplThread( TexturesMemorySize(8), 104, ResourceProvider()); - EXPECT_EQ(0u, EvictedBackingCount(resource_manager.get())); + EXPECT_EQ(0, EvictedBackingCount(resource_manager.get())); resource_manager->ReduceMemoryOnImplThread( TexturesMemorySize(8), 103, ResourceProvider()); - EXPECT_EQ(1u, EvictedBackingCount(resource_manager.get())); + EXPECT_EQ(1, EvictedBackingCount(resource_manager.get())); } resource_manager->UnlinkAndClearEvictedBackings(); EXPECT_EQ(TexturesMemorySize(3), resource_manager->MemoryUseBytes()); @@ -704,19 +704,19 @@ TEST_F(PrioritizedResourceTest, ClearUploadsToEvictedResources) { EXPECT_TRUE(textures[i]->have_backing_texture()); queue.ClearUploadsToEvictedResources(); - EXPECT_EQ(4u, queue.FullUploadSize()); + EXPECT_EQ(4, queue.FullUploadSize()); resource_manager->ReduceMemoryOnImplThread( TexturesMemorySize(1), PriorityCalculator::AllowEverythingCutoff(), ResourceProvider()); queue.ClearUploadsToEvictedResources(); - EXPECT_EQ(1u, queue.FullUploadSize()); + EXPECT_EQ(1, queue.FullUploadSize()); resource_manager->ReduceMemoryOnImplThread( 0, PriorityCalculator::AllowEverythingCutoff(), ResourceProvider()); queue.ClearUploadsToEvictedResources(); - EXPECT_EQ(0u, queue.FullUploadSize()); + EXPECT_EQ(0, queue.FullUploadSize()); } TEST_F(PrioritizedResourceTest, UsageStatistics) { diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc index 7e3d15c..6a5ea23 100644 --- a/cc/resources/resource_provider_unittest.cc +++ b/cc/resources/resource_provider_unittest.cc @@ -139,7 +139,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { } virtual void bindTexture(WGC3Denum target, WebGLId texture) OVERRIDE { - ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); + ASSERT_EQ(target, GL_TEXTURE_2D); ASSERT_TRUE(!texture || textures_.find(texture) != textures_.end()); current_texture_ = texture; } @@ -164,8 +164,8 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { WGC3Dint width, WGC3Dint height) OVERRIDE { ASSERT_TRUE(current_texture_); - ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); - ASSERT_EQ(1, levels); + ASSERT_EQ(target, GL_TEXTURE_2D); + ASSERT_EQ(levels, 1); WGC3Denum format = GL_RGBA; switch (internalformat) { case GL_RGBA8_OES: @@ -189,11 +189,11 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { WGC3Denum type, const void* pixels) OVERRIDE { ASSERT_TRUE(current_texture_); - ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); + ASSERT_EQ(target, GL_TEXTURE_2D); ASSERT_FALSE(level); ASSERT_EQ(internalformat, format); ASSERT_FALSE(border); - ASSERT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type); + ASSERT_EQ(type, GL_UNSIGNED_BYTE); AllocateTexture(gfx::Size(width, height), format); if (pixels) SetPixels(0, 0, width, height, pixels); @@ -209,11 +209,11 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { WGC3Denum type, const void* pixels) OVERRIDE { ASSERT_TRUE(current_texture_); - ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); + ASSERT_EQ(target, GL_TEXTURE_2D); ASSERT_FALSE(level); ASSERT_TRUE(textures_.get(current_texture_)); ASSERT_EQ(textures_.get(current_texture_)->format, format); - ASSERT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type); + ASSERT_EQ(type, GL_UNSIGNED_BYTE); ASSERT_TRUE(pixels); SetPixels(xoffset, yoffset, width, height, pixels); } @@ -221,7 +221,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { virtual void texParameteri(WGC3Denum target, WGC3Denum param, WGC3Dint value) OVERRIDE { ASSERT_TRUE(current_texture_); - ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); + ASSERT_EQ(target, GL_TEXTURE_2D); Texture* texture = textures_.get(current_texture_); ASSERT_TRUE(texture); if (param != GL_TEXTURE_MIN_FILTER) @@ -236,7 +236,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { virtual void produceTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) OVERRIDE { ASSERT_TRUE(current_texture_); - ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); + ASSERT_EQ(target, GL_TEXTURE_2D); // Delay moving the texture into the mailbox until the next // InsertSyncPoint, so that it is not visible to other contexts that @@ -251,7 +251,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { virtual void consumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) OVERRIDE { ASSERT_TRUE(current_texture_); - ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); + ASSERT_EQ(target, GL_TEXTURE_2D); textures_.set( current_texture_, shared_data_->ConsumeTexture(mailbox, last_waited_sync_point_)); @@ -679,11 +679,9 @@ TEST_P(ResourceProviderTest, TextureFilters) { uint8_t data[4] = { 1, 2, 3, 4 }; gfx::Rect rect(size); child_resource_provider->SetPixels(id, data, rect, rect, gfx::Vector2d()); - EXPECT_EQ(static_cast<unsigned>(GL_LINEAR), - GetResourceFilter(child_resource_provider.get(), id)); + EXPECT_EQ(GL_LINEAR, GetResourceFilter(child_resource_provider.get(), id)); SetResourceFilter(child_resource_provider.get(), id, GL_NEAREST); - EXPECT_EQ(static_cast<unsigned>(GL_NEAREST), - GetResourceFilter(child_resource_provider.get(), id)); + EXPECT_EQ(GL_NEAREST, GetResourceFilter(child_resource_provider.get(), id)); int child_id = resource_provider_->CreateChild(); { @@ -694,18 +692,16 @@ TEST_P(ResourceProviderTest, TextureFilters) { child_resource_provider->PrepareSendToParent(resource_ids_to_transfer, &list); ASSERT_EQ(1u, list.size()); - EXPECT_EQ(static_cast<unsigned>(GL_NEAREST), list[0].filter); + EXPECT_EQ(GL_NEAREST, list[0].filter); resource_provider_->ReceiveFromChild(child_id, list); } ResourceProvider::ResourceIdMap resource_map = resource_provider_->GetChildToParentMap(child_id); ResourceProvider::ResourceId mapped_id = resource_map[id]; EXPECT_NE(0u, mapped_id); - EXPECT_EQ(static_cast<unsigned>(GL_NEAREST), - GetResourceFilter(resource_provider_.get(), mapped_id)); + EXPECT_EQ(GL_NEAREST, GetResourceFilter(resource_provider_.get(), mapped_id)); SetResourceFilter(resource_provider_.get(), mapped_id, GL_LINEAR); - EXPECT_EQ(static_cast<unsigned>(GL_LINEAR), - GetResourceFilter(resource_provider_.get(), mapped_id)); + EXPECT_EQ(GL_LINEAR, GetResourceFilter(resource_provider_.get(), mapped_id)); { // Transfer resources back from the parent to the child. ResourceProvider::ResourceIdArray resource_ids_to_transfer; @@ -714,14 +710,12 @@ TEST_P(ResourceProviderTest, TextureFilters) { resource_provider_->PrepareSendToChild( child_id, resource_ids_to_transfer, &list); ASSERT_EQ(1u, list.size()); - EXPECT_EQ(static_cast<unsigned>(GL_LINEAR), list[0].filter); + EXPECT_EQ(GL_LINEAR, list[0].filter); child_resource_provider->ReceiveFromParent(list); } - EXPECT_EQ(static_cast<unsigned>(GL_LINEAR), - GetResourceFilter(child_resource_provider.get(), id)); + EXPECT_EQ(GL_LINEAR, GetResourceFilter(child_resource_provider.get(), id)); SetResourceFilter(child_resource_provider.get(), id, GL_NEAREST); - EXPECT_EQ(static_cast<unsigned>(GL_NEAREST), - GetResourceFilter(child_resource_provider.get(), id)); + EXPECT_EQ(GL_NEAREST, GetResourceFilter(child_resource_provider.get(), id)); } void ReleaseTextureMailbox(unsigned* release_sync_point, unsigned sync_point) { @@ -751,7 +745,7 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) { ResourceProvider::ResourceId resource = resource_provider_->CreateResourceFromTextureMailbox( TextureMailbox(mailbox, callback, sync_point)); - EXPECT_EQ(1, context()->texture_count()); + EXPECT_EQ(1u, context()->texture_count()); EXPECT_EQ(0u, release_sync_point); { // Transfer the resource, expect the sync points to be consistent. @@ -761,7 +755,7 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) { resource_provider_->PrepareSendToParent(resource_ids_to_transfer, &list); ASSERT_EQ(1u, list.size()); EXPECT_LE(sync_point, list[0].sync_point); - EXPECT_EQ(0, + EXPECT_EQ(0u, memcmp(mailbox.name, list[0].mailbox.name, sizeof(mailbox.name))); EXPECT_EQ(0u, release_sync_point); @@ -771,7 +765,7 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) { context()->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); uint8_t test_data[4] = { 0 }; context()->GetPixels(gfx::Size(1, 1), GL_RGBA, test_data); - EXPECT_EQ(0, memcmp(data, test_data, sizeof(data))); + EXPECT_EQ(0u, memcmp(data, test_data, sizeof(data))); context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); context()->deleteTexture(other_texture); list[0].sync_point = context()->insertSyncPoint(); @@ -780,7 +774,7 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) { // Receive the resource, then delete it, expect the sync points to be // consistent. resource_provider_->ReceiveFromParent(list); - EXPECT_EQ(1, context()->texture_count()); + EXPECT_EQ(1u, context()->texture_count()); EXPECT_EQ(0u, release_sync_point); resource_provider_->DeleteResource(resource); @@ -794,7 +788,7 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) { release_sync_point = 0; resource = resource_provider_->CreateResourceFromTextureMailbox( TextureMailbox(mailbox, callback, sync_point)); - EXPECT_EQ(1, context()->texture_count()); + EXPECT_EQ(1u, context()->texture_count()); EXPECT_EQ(0u, release_sync_point); { // Transfer the resource, expect the sync points to be consistent. @@ -804,7 +798,7 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) { resource_provider_->PrepareSendToParent(resource_ids_to_transfer, &list); ASSERT_EQ(1u, list.size()); EXPECT_LE(sync_point, list[0].sync_point); - EXPECT_EQ(0, + EXPECT_EQ(0u, memcmp(mailbox.name, list[0].mailbox.name, sizeof(mailbox.name))); EXPECT_EQ(0u, release_sync_point); @@ -814,7 +808,7 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) { context()->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); uint8_t test_data[4] = { 0 }; context()->GetPixels(gfx::Size(1, 1), GL_RGBA, test_data); - EXPECT_EQ(0, memcmp(data, test_data, sizeof(data))); + EXPECT_EQ(0u, memcmp(data, test_data, sizeof(data))); context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); context()->deleteTexture(other_texture); list[0].sync_point = context()->insertSyncPoint(); @@ -822,7 +816,7 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) { // Delete the resource, which shouldn't do anything. resource_provider_->DeleteResource(resource); - EXPECT_EQ(1, context()->texture_count()); + EXPECT_EQ(1u, context()->texture_count()); EXPECT_EQ(0u, release_sync_point); // Then receive the resource which should release the mailbox, expect the @@ -955,7 +949,6 @@ TEST_P(ResourceProviderTest, ManagedResource) { GL_TEXTURE_POOL_MANAGED_CHROMIUM)); ResourceProvider::ResourceId id = resource_provider->CreateManagedResource( size, format, ResourceProvider::TextureUsageAny); - EXPECT_NE(0u, id); Mock::VerifyAndClearExpectations(context); } diff --git a/cc/resources/resource_update_controller_unittest.cc b/cc/resources/resource_update_controller_unittest.cc index 8b751c3..c4a8ee75 100644 --- a/cc/resources/resource_update_controller_unittest.cc +++ b/cc/resources/resource_update_controller_unittest.cc @@ -72,7 +72,6 @@ class ResourceUpdateControllerTest : public Test { : proxy_(scoped_ptr<Thread>(NULL)), queue_(make_scoped_ptr(new ResourceUpdateQueue)), resource_manager_(PrioritizedResourceManager::Create(&proxy_)), - query_results_available_(0), full_upload_count_expected_(0), partial_count_expected_(0), total_upload_count_expected_(0), @@ -80,7 +79,8 @@ class ResourceUpdateControllerTest : public Test { num_consecutive_flushes_(0), num_dangling_uploads_(0), num_total_uploads_(0), - num_total_flushes_(0) {} + num_total_flushes_(0), + query_results_available_(0) {} virtual ~ResourceUpdateControllerTest() { DebugScopedSetImplThreadAndMainThreadBlocked diff --git a/cc/resources/scoped_resource.cc b/cc/resources/scoped_resource.cc index 14209e0..b31272f 100644 --- a/cc/resources/scoped_resource.cc +++ b/cc/resources/scoped_resource.cc @@ -27,7 +27,7 @@ bool ScopedResource::Allocate(const gfx::Size& size, GLenum format, allocate_thread_id_ = base::PlatformThread::CurrentId(); #endif - return id() != 0; + return id(); } void ScopedResource::Free() { diff --git a/cc/resources/scoped_resource_unittest.cc b/cc/resources/scoped_resource_unittest.cc index 97e93d2..a9a087e 100644 --- a/cc/resources/scoped_resource_unittest.cc +++ b/cc/resources/scoped_resource_unittest.cc @@ -42,7 +42,7 @@ TEST(ScopedResourceTest, CreateScopedResource) { EXPECT_EQ(expected_bytes, texture->bytes()); EXPECT_LT(0u, texture->id()); - EXPECT_EQ(static_cast<unsigned>(GL_RGBA), texture->format()); + EXPECT_EQ(GL_RGBA, texture->format()); EXPECT_EQ(gfx::Size(30, 30), texture->size()); } diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 47b7f36..ed00374 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -31,12 +31,12 @@ namespace { #if defined(OS_ANDROID) // For reference, the Nexus10 can upload 1MB in about 2.5ms. // Assuming a three frame deep pipeline this implies ~20MB. -const size_t kMaxPendingUploadBytes = 20 * 1024 * 1024; +const int kMaxPendingUploadBytes = 20 * 1024 * 1024; // TODO(epenner): We should remove this upload limit (crbug.com/176197) -const size_t kMaxPendingUploads = 72; +const int kMaxPendingUploads = 72; #else -const size_t kMaxPendingUploadBytes = 100 * 1024 * 1024; -const size_t kMaxPendingUploads = 1000; +const int kMaxPendingUploadBytes = 100 * 1024 * 1024; +const int kMaxPendingUploads = 1000; #endif #if defined(OS_ANDROID) @@ -165,14 +165,14 @@ TileManager::TileManager( bytes_pending_upload_(0), has_performed_uploads_since_last_flush_(false), ever_exceeded_memory_budget_(false), - rendering_stats_instrumentation_(rendering_stats_instrumentation), max_prepaint_tile_distance_(max_prepaint_tile_distance), use_cheapness_estimator_(use_cheapness_estimator), use_color_estimator_(use_color_estimator), prediction_benchmarking_(prediction_benchmarking), did_initialize_visible_tile_(false), pending_tasks_(0), - max_pending_tasks_(kMaxNumPendingTasksPerThread * num_raster_threads) { + max_pending_tasks_(kMaxNumPendingTasksPerThread * num_raster_threads), + rendering_stats_instrumentation_(rendering_stats_instrumentation) { for (int i = 0; i < NUM_STATES; ++i) { for (int j = 0; j < NUM_TREES; ++j) { for (int k = 0; k < NUM_BINS; ++k) @@ -190,9 +190,9 @@ TileManager::~TileManager() { // resources. raster_worker_pool_.reset(); AbortPendingTileUploads(); - DCHECK_EQ(0u, tiles_with_pending_upload_.size()); - DCHECK_EQ(0u, all_tiles_.size()); - DCHECK_EQ(0u, live_or_allocated_tiles_.size()); + DCHECK_EQ(tiles_with_pending_upload_.size(), 0); + DCHECK_EQ(all_tiles_.size(), 0); + DCHECK_EQ(live_or_allocated_tiles_.size(), 0); } void TileManager::SetGlobalState( @@ -1034,7 +1034,7 @@ void TileManager::RunRasterTask( RecordCheapnessPredictorResults(is_predicted_cheap, is_actually_cheap); DCHECK_EQ(bitmap.rowBytes(), - static_cast<size_t>(bitmap.width() * bitmap.bytesPerPixel())); + bitmap.width() * bitmap.bytesPerPixel()); RecordSolidColorPredictorResults( reinterpret_cast<SkColor*>(bitmap.getPixels()), diff --git a/cc/scheduler/frame_rate_controller.cc b/cc/scheduler/frame_rate_controller.cc index 93665da..27b7ba6 100644 --- a/cc/scheduler/frame_rate_controller.cc +++ b/cc/scheduler/frame_rate_controller.cc @@ -39,8 +39,8 @@ FrameRateController::FrameRateController(scoped_refptr<TimeSource> timer) active_(false), swap_buffers_complete_supported_(true), is_time_source_throttling_(true), - weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), - thread_(NULL) { + thread_(NULL), + weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { time_source_client_adapter_ = FrameRateControllerTimeSourceAdapter::Create(this); time_source_->SetClient(time_source_client_adapter_.get()); @@ -53,8 +53,8 @@ FrameRateController::FrameRateController(Thread* thread) active_(false), swap_buffers_complete_supported_(true), is_time_source_throttling_(false), - weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), - thread_(thread) {} + thread_(thread), + weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {} FrameRateController::~FrameRateController() { if (is_time_source_throttling_) diff --git a/cc/scheduler/rate_limiter.cc b/cc/scheduler/rate_limiter.cc index 3508adf..df11acd 100644 --- a/cc/scheduler/rate_limiter.cc +++ b/cc/scheduler/rate_limiter.cc @@ -20,10 +20,10 @@ scoped_refptr<RateLimiter> RateLimiter::Create( RateLimiter::RateLimiter(WebKit::WebGraphicsContext3D* context, RateLimiterClient* client, Thread* thread) - : context_(context), + : thread_(thread), + context_(context), active_(false), - client_(client), - thread_(thread) { + client_(client) { DCHECK(context); } diff --git a/cc/scheduler/texture_uploader.cc b/cc/scheduler/texture_uploader.cc index de365de..dd89e8c 100644 --- a/cc/scheduler/texture_uploader.cc +++ b/cc/scheduler/texture_uploader.cc @@ -33,7 +33,7 @@ static const size_t kUploadHistorySizeInitial = 100; static const double kDefaultEstimatedTexturesPerSecond = 48.0 * 60.0; // Flush interval when performing texture uploads. -static const size_t kTextureUploadFlushPeriod = 4; +static const int kTextureUploadFlushPeriod = 4; } // anonymous namespace diff --git a/cc/scheduler/texture_uploader_unittest.cc b/cc/scheduler/texture_uploader_unittest.cc index f4b4ce6..d5c8e49 100644 --- a/cc/scheduler/texture_uploader_unittest.cc +++ b/cc/scheduler/texture_uploader_unittest.cc @@ -70,7 +70,7 @@ class TestWebGraphicsContext3DTextureUpload : public TestWebGraphicsContext3D { WGC3Denum format, WGC3Denum type, const void* pixels) OVERRIDE { - EXPECT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); + EXPECT_EQ(GL_TEXTURE_2D, target); EXPECT_EQ(0, level); EXPECT_LE(0, width); EXPECT_LE(0, height); @@ -83,12 +83,12 @@ class TestWebGraphicsContext3DTextureUpload : public TestWebGraphicsContext3D { unsigned int bytes_per_pixel = 0; switch (format) { case GL_ALPHA: - EXPECT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type); + EXPECT_EQ(GL_UNSIGNED_BYTE, type); bytes_per_pixel = 1; break; case GL_RGB: - EXPECT_NE(static_cast<unsigned>(GL_UNSIGNED_SHORT_4_4_4_4), type); - EXPECT_NE(static_cast<unsigned>(GL_UNSIGNED_SHORT_5_5_5_1), type); + EXPECT_NE(GL_UNSIGNED_SHORT_4_4_4_4, type); + EXPECT_NE(GL_UNSIGNED_SHORT_5_5_5_1, type); switch (type) { case GL_UNSIGNED_BYTE: bytes_per_pixel = 3; @@ -99,7 +99,7 @@ class TestWebGraphicsContext3DTextureUpload : public TestWebGraphicsContext3D { } break; case GL_RGBA: - EXPECT_NE(static_cast<unsigned>(GL_UNSIGNED_SHORT_5_6_5), type); + EXPECT_NE(GL_UNSIGNED_SHORT_5_6_5, type); switch (type) { case GL_UNSIGNED_BYTE: bytes_per_pixel = 4; @@ -113,11 +113,11 @@ class TestWebGraphicsContext3DTextureUpload : public TestWebGraphicsContext3D { } break; case GL_LUMINANCE: - EXPECT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type); + EXPECT_EQ(GL_UNSIGNED_BYTE, type); bytes_per_pixel = 1; break; case GL_LUMINANCE_ALPHA: - EXPECT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type); + EXPECT_EQ(GL_UNSIGNED_BYTE, type); bytes_per_pixel = 2; break; } @@ -144,8 +144,8 @@ class TestWebGraphicsContext3DTextureUpload : public TestWebGraphicsContext3D { } private: - unsigned result_available_; unsigned unpack_alignment_; + unsigned result_available_; DISALLOW_COPY_AND_ASSIGN(TestWebGraphicsContext3DTextureUpload); }; @@ -169,19 +169,19 @@ TEST(TextureUploaderTest, NumBlockingUploads) { TextureUploader::Create(fake_context.get(), false, false); fake_context->SetResultAvailable(0); - EXPECT_EQ(0u, uploader->NumBlockingUploads()); + EXPECT_EQ(0, uploader->NumBlockingUploads()); UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL); - EXPECT_EQ(1u, uploader->NumBlockingUploads()); + EXPECT_EQ(1, uploader->NumBlockingUploads()); UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL); - EXPECT_EQ(2u, uploader->NumBlockingUploads()); + EXPECT_EQ(2, uploader->NumBlockingUploads()); fake_context->SetResultAvailable(1); - EXPECT_EQ(0u, uploader->NumBlockingUploads()); + EXPECT_EQ(0, uploader->NumBlockingUploads()); UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL); - EXPECT_EQ(0u, uploader->NumBlockingUploads()); + EXPECT_EQ(0, uploader->NumBlockingUploads()); UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL); UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL); - EXPECT_EQ(0u, uploader->NumBlockingUploads()); + EXPECT_EQ(0, uploader->NumBlockingUploads()); } TEST(TextureUploaderTest, MarkPendingUploadsAsNonBlocking) { @@ -191,21 +191,21 @@ TEST(TextureUploaderTest, MarkPendingUploadsAsNonBlocking) { TextureUploader::Create(fake_context.get(), false, false); fake_context->SetResultAvailable(0); - EXPECT_EQ(0u, uploader->NumBlockingUploads()); + EXPECT_EQ(0, uploader->NumBlockingUploads()); UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL); UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL); - EXPECT_EQ(2u, uploader->NumBlockingUploads()); + EXPECT_EQ(2, uploader->NumBlockingUploads()); uploader->MarkPendingUploadsAsNonBlocking(); - EXPECT_EQ(0u, uploader->NumBlockingUploads()); + EXPECT_EQ(0, uploader->NumBlockingUploads()); UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL); - EXPECT_EQ(1u, uploader->NumBlockingUploads()); + EXPECT_EQ(1, uploader->NumBlockingUploads()); fake_context->SetResultAvailable(1); - EXPECT_EQ(0u, uploader->NumBlockingUploads()); + EXPECT_EQ(0, uploader->NumBlockingUploads()); UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL); uploader->MarkPendingUploadsAsNonBlocking(); - EXPECT_EQ(0u, uploader->NumBlockingUploads()); + EXPECT_EQ(0, uploader->NumBlockingUploads()); } TEST(TextureUploaderTest, UploadContentsTest) { diff --git a/cc/scheduler/vsync_time_source.cc b/cc/scheduler/vsync_time_source.cc index 75314fb..1483478 100644 --- a/cc/scheduler/vsync_time_source.cc +++ b/cc/scheduler/vsync_time_source.cc @@ -12,10 +12,10 @@ scoped_refptr<VSyncTimeSource> VSyncTimeSource::Create( } VSyncTimeSource::VSyncTimeSource(VSyncProvider* vsync_provider) - : active_(false), - notification_requested_(false), - vsync_provider_(vsync_provider), - client_(NULL) {} + : vsync_provider_(vsync_provider) + , client_(NULL) + , active_(false) + , notification_requested_(false) {} VSyncTimeSource::~VSyncTimeSource() {} diff --git a/cc/trees/layer_sorter.cc b/cc/trees/layer_sorter.cc index 51fa4b6..232f29f 100644 --- a/cc/trees/layer_sorter.cc +++ b/cc/trees/layer_sorter.cc @@ -70,7 +70,7 @@ LayerSorter::LayerSorter() LayerSorter::~LayerSorter() {} -static float CheckFloatingPointNumericAccuracy(float a, float b) { +static float const CheckFloatingPointNumericAccuracy(float a, float b) { float abs_dif = std::abs(b - a); float abs_max = std::max(std::abs(b), std::abs(a)); // Check to see if we've got a result with a reasonable amount of error. diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 3dd7b4c..4e5542d 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -86,12 +86,12 @@ LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client, num_failed_recreate_attempts_(0), settings_(settings), debug_state_(settings.initial_debug_state), - overdraw_bottom_height_(0.f), device_scale_factor_(1.f), visible_(true), page_scale_factor_(1.f), min_page_scale_factor_(1.f), max_page_scale_factor_(1.f), + overdraw_bottom_height_(0.f), trigger_idle_updates_(true), background_color_(SK_ColorWHITE), has_transparent_background_(false), diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc index e5976ce..d4ff04e 100644 --- a/cc/trees/layer_tree_host_common.cc +++ b/cc/trees/layer_tree_host_common.cc @@ -1332,7 +1332,7 @@ void LayerTreeHostCommon::CalculateDrawProperties( update_tile_priorities); // The dummy layer list should not have been used. - DCHECK_EQ(0u, dummy_layer_list.size()); + DCHECK_EQ(dummy_layer_list.size(), 0); // A root layer render_surface should always exist after // CalculateDrawProperties. DCHECK(root_layer->render_surface()); @@ -1385,7 +1385,7 @@ void LayerTreeHostCommon::CalculateDrawProperties( update_tile_priorities); // The dummy layer list should not have been used. - DCHECK_EQ(0u, dummy_layer_list.size()); + DCHECK_EQ(dummy_layer_list.size(), 0); // A root layer render_surface should always exist after // CalculateDrawProperties. DCHECK(root_layer->render_surface()); diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 3d975ee..76095de 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1108,7 +1108,7 @@ void LayerTreeHostImpl::Readback(void* pixels, } bool LayerTreeHostImpl::haveRootScrollLayer() const { - return !!RootScrollLayer(); + return RootScrollLayer(); } LayerImpl* LayerTreeHostImpl::RootLayer() const { @@ -1395,7 +1395,7 @@ void LayerTreeHostImpl::setNeedsRedraw() { bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() { active_tree_->UpdateDrawProperties(LayerTreeImpl::UPDATE_ACTIVE_TREE); - return !active_tree_->RenderSurfaceLayerList().empty(); + return active_tree_->RenderSurfaceLayerList().size(); } InputHandlerClient::ScrollStatus LayerTreeHostImpl::ScrollBegin( diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 737ef2a..1e62999 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -1579,7 +1579,6 @@ TEST_F(LayerTreeHostImplTest, PageScaleDeltaAppliedToRootScrollLayerOnly) { gfx::Size surface_size(10, 10); float default_page_scale = 1.f; gfx::Transform default_page_scale_matrix; - default_page_scale_matrix.Scale(default_page_scale, default_page_scale); float new_page_scale = 2.f; gfx::Transform new_page_scale_matrix; @@ -2978,6 +2977,18 @@ class TrackingWebGraphicsContext3D : public TestWebGraphicsContext3D { unsigned num_textures_; }; +static unsigned CreateResourceId(ResourceProvider* resource_provider) { + return resource_provider->CreateResource( + gfx::Size(20, 12), + resource_provider->best_texture_format(), + ResourceProvider::TextureUsageAny); +} + +static unsigned CreateTextureId(ResourceProvider* resource_provider) { + return ResourceProvider::ScopedReadLockGL( + resource_provider, CreateResourceId(resource_provider)).texture_id(); +} + TEST_F(LayerTreeHostImplTest, LayersFreeTextures) { scoped_ptr<TestWebGraphicsContext3D> context = TestWebGraphicsContext3D::Create(); diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 767c00d..8a403c4 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -787,9 +787,9 @@ class LayerTreeHostTestAtomicCommit : public LayerTreeHostTest { switch (impl->active_tree()->source_frame_number()) { case 0: // Number of textures should be one for each layer - ASSERT_EQ(2u, context->NumTextures()); + ASSERT_EQ(2, context->NumTextures()); // Number of textures used for commit should be one for each layer. - EXPECT_EQ(2u, context->NumUsedTextures()); + EXPECT_EQ(2, context->NumUsedTextures()); // Verify that used texture is correct. EXPECT_TRUE(context->UsedTexture(context->TextureAt(0))); EXPECT_TRUE(context->UsedTexture(context->TextureAt(1))); @@ -800,10 +800,10 @@ class LayerTreeHostTestAtomicCommit : public LayerTreeHostTest { case 1: // Number of textures should be doubled as the first textures // are used by impl thread and cannot by used for update. - ASSERT_EQ(4u, context->NumTextures()); + ASSERT_EQ(4, context->NumTextures()); // Number of textures used for commit should still be // one for each layer. - EXPECT_EQ(2u, context->NumUsedTextures()); + EXPECT_EQ(2, context->NumUsedTextures()); // First textures should not have been used. EXPECT_FALSE(context->UsedTexture(context->TextureAt(0))); EXPECT_FALSE(context->UsedTexture(context->TextureAt(1))); @@ -828,7 +828,7 @@ class LayerTreeHostTestAtomicCommit : public LayerTreeHostTest { impl->output_surface()->context3d()); // Number of textures used for draw should always be one for each layer. - EXPECT_EQ(2u, context->NumUsedTextures()); + EXPECT_EQ(2, context->NumUsedTextures()); context->ResetUsedTextures(); } @@ -916,9 +916,9 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate switch (impl->active_tree()->source_frame_number()) { case 0: // Number of textures should be one for each layer. - ASSERT_EQ(4u, context->NumTextures()); + ASSERT_EQ(4, context->NumTextures()); // Number of textures used for commit should be one for each layer. - EXPECT_EQ(4u, context->NumUsedTextures()); + EXPECT_EQ(4, context->NumUsedTextures()); // Verify that used textures are correct. EXPECT_TRUE(context->UsedTexture(context->TextureAt(0))); EXPECT_TRUE(context->UsedTexture(context->TextureAt(1))); @@ -931,10 +931,10 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate case 1: // Number of textures should be two for each content layer and one // for each scrollbar, since they always do a partial update. - ASSERT_EQ(6u, context->NumTextures()); + ASSERT_EQ(6, context->NumTextures()); // Number of textures used for commit should be one for each content // layer, and one for the scrollbar layer that paints. - EXPECT_EQ(3u, context->NumUsedTextures()); + EXPECT_EQ(3, context->NumUsedTextures()); // First content textures should not have been used. EXPECT_FALSE(context->UsedTexture(context->TextureAt(0))); @@ -953,10 +953,10 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate case 2: // Number of textures should be two for each content layer and one // for each scrollbar, since they always do a partial update. - ASSERT_EQ(6u, context->NumTextures()); + ASSERT_EQ(6, context->NumTextures()); // Number of textures used for commit should be one for each content // layer, and one for the scrollbar layer that paints. - EXPECT_EQ(3u, context->NumUsedTextures()); + EXPECT_EQ(3, context->NumUsedTextures()); // The non-painting scrollbar's texture wasn't updated. EXPECT_FALSE(context->UsedTexture(context->TextureAt(2))); @@ -971,7 +971,7 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate break; case 3: // No textures should be used for commit. - EXPECT_EQ(0u, context->NumUsedTextures()); + EXPECT_EQ(0, context->NumUsedTextures()); context->ResetUsedTextures(); PostSetNeedsCommitToMainThread(); @@ -980,7 +980,7 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate // Number of textures used for commit should be two. One for the // content layer, and one for the painting scrollbar. The // non-painting scrollbar doesn't update its texture. - EXPECT_EQ(2u, context->NumUsedTextures()); + EXPECT_EQ(2, context->NumUsedTextures()); context->ResetUsedTextures(); PostSetNeedsCommitToMainThread(); @@ -1001,9 +1001,9 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate // Number of textures used for drawing should one per layer except for // frame 3 where the viewport only contains one layer. if (impl->active_tree()->source_frame_number() == 3) - EXPECT_EQ(1u, context->NumUsedTextures()); + EXPECT_EQ(1, context->NumUsedTextures()); else - EXPECT_EQ(4u, context->NumUsedTextures()); + EXPECT_EQ(4, context->NumUsedTextures()); context->ResetUsedTextures(); } @@ -1816,7 +1816,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, bool visible) OVERRIDE { // One backing should remain unevicted. - EXPECT_EQ(100u * 100u * 4u * 1u, + EXPECT_EQ(100 * 100 * 4 * 1, layer_tree_host()->contents_texture_manager()->MemoryUseBytes()); // Make sure that contents textures are marked as having been // purged. @@ -1831,7 +1831,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted case 1: // All three backings should have memory. EXPECT_EQ( - 100u * 100u * 4u * 3u, + 100 * 100 * 4 * 3, layer_tree_host()->contents_texture_manager()->MemoryUseBytes()); // Set a new policy that will kick out 1 of the 3 resources. // Because a resource was evicted, a commit will be kicked off. @@ -1844,7 +1844,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted case 2: // Only two backings should have memory. EXPECT_EQ( - 100u * 100u * 4u * 2u, + 100 * 100 * 4 * 2, layer_tree_host()->contents_texture_manager()->MemoryUseBytes()); // Become backgrounded, which will cause 1 more resource to be // evicted. @@ -1889,7 +1889,7 @@ class LayerTreeHostTestPinchZoomScrollbarCreation : public LayerTreeHostTest { virtual void DidCommit() OVERRIDE { // We always expect two pinch-zoom scrollbar layers. - ASSERT_EQ(2u, root_layer_->children().size()); + ASSERT_EQ(2, root_layer_->children().size()); // Pinch-zoom scrollbar layers always have invalid scrollLayerIds. ScrollbarLayer* layer1 = root_layer_->children()[0]->ToScrollbarLayer(); @@ -1998,7 +1998,7 @@ class LayerTreeHostTestPinchZoomScrollbarNewRootLayer num_commits_++; // We always expect two pinch-zoom scrollbar layers. - ASSERT_EQ(2u, root_layer_->children().size()); + ASSERT_EQ(2, root_layer_->children().size()); // Pinch-zoom scrollbar layers always have invalid scrollLayerIds. ScrollbarLayer* layer1 = root_layer_->children()[0]->ToScrollbarLayer(); diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index 38cc0c5..b6a79b3 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -388,7 +388,7 @@ class LayerTreeHostAnimationTestDoNotSkipLayersWithAnimatedOpacity virtual void AfterTest() OVERRIDE { // Update() should have been called once, proving that the layer was not // skipped. - EXPECT_EQ(1u, update_check_layer_->update_count()); + EXPECT_EQ(1, update_check_layer_->update_count()); // clear update_check_layer_ so LayerTreeHost dies. update_check_layer_ = NULL; diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc index 6b95121..b1e3205 100644 --- a/cc/trees/layer_tree_host_unittest_context.cc +++ b/cc/trees/layer_tree_host_unittest_context.cc @@ -213,8 +213,8 @@ class LayerTreeHostContextTest : public LayerTreeTest { int times_to_lose_on_create_; int times_to_lose_during_commit_; int times_to_lose_during_draw_; - int times_to_fail_recreate_; int times_to_fail_reinitialize_; + int times_to_fail_recreate_; int times_to_lose_on_recreate_; int times_to_fail_create_offscreen_; int times_to_fail_recreate_offscreen_; @@ -247,7 +247,7 @@ class LayerTreeHostContextTestLostContextSucceeds } virtual void AfterTest() OVERRIDE { - EXPECT_EQ(10u, test_case_); + EXPECT_EQ(10, test_case_); EXPECT_EQ(8 + 10 + 10, num_losses_); } @@ -1203,14 +1203,14 @@ class ScrollbarLayerLostContext : public LayerTreeHostContextTest { // First (regular) update, we should upload 2 resources (thumb, and // backtrack). EXPECT_EQ(1, scrollbar_layer_->update_count()); - EXPECT_EQ(2u, upload_count); + EXPECT_EQ(2, upload_count); LoseContext(); break; case 2: // Second update, after the lost context, we should still upload 2 // resources even if the contents haven't changed. EXPECT_EQ(2, scrollbar_layer_->update_count()); - EXPECT_EQ(2u, upload_count); + EXPECT_EQ(2, upload_count); EndTest(); break; default: diff --git a/cc/trees/layer_tree_host_unittest_delegated.cc b/cc/trees/layer_tree_host_unittest_delegated.cc index cc81707..c120884 100644 --- a/cc/trees/layer_tree_host_unittest_delegated.cc +++ b/cc/trees/layer_tree_host_unittest_delegated.cc @@ -410,9 +410,9 @@ class LayerTreeHostDelegatedTestRemapResourcesInQuads EXPECT_EQ(1u, map.count(555)); ResourceProvider::ResourceId parent_resource_id1 = map.find(999)->second; - EXPECT_NE(parent_resource_id1, 999u); + EXPECT_NE(parent_resource_id1, 999); ResourceProvider::ResourceId parent_resource_id2 = map.find(555)->second; - EXPECT_NE(parent_resource_id2, 555u); + EXPECT_NE(parent_resource_id2, 555); // The resources in the quads should be remapped to the parent's namespace. const TextureDrawQuad* quad1 = TextureDrawQuad::MaterialCast( @@ -468,7 +468,7 @@ class LayerTreeHostDelegatedTestReturnUnusedResources // 555 is no longer in use. delegated_->TakeUnusedResourcesForChildCompositor(&resources); EXPECT_EQ(1u, resources.size()); - EXPECT_EQ(555u, resources[0].id); + EXPECT_EQ(555, resources[0].id); // Stop using any resources. frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); @@ -479,11 +479,11 @@ class LayerTreeHostDelegatedTestReturnUnusedResources delegated_->TakeUnusedResourcesForChildCompositor(&resources); EXPECT_EQ(2u, resources.size()); if (resources[0].id == 999) { - EXPECT_EQ(999u, resources[0].id); - EXPECT_EQ(444u, resources[1].id); + EXPECT_EQ(999, resources[0].id); + EXPECT_EQ(444, resources[1].id); } else { - EXPECT_EQ(444u, resources[0].id); - EXPECT_EQ(999u, resources[1].id); + EXPECT_EQ(444, resources[0].id); + EXPECT_EQ(999, resources[1].id); } EndTest(); break; @@ -548,7 +548,7 @@ class LayerTreeHostDelegatedTestReusedResources // The 999 resource is the only unused one. delegated_->TakeUnusedResourcesForChildCompositor(&resources); EXPECT_EQ(1u, resources.size()); - EXPECT_EQ(999u, resources[0].id); + EXPECT_EQ(999, resources[0].id); EndTest(); break; } @@ -603,11 +603,11 @@ class LayerTreeHostDelegatedTestFrameBeforeAck delegated_->TakeUnusedResourcesForChildCompositor(&resources); EXPECT_EQ(2u, resources.size()); if (resources[0].id == 555) { - EXPECT_EQ(555u, resources[0].id); - EXPECT_EQ(444u, resources[1].id); + EXPECT_EQ(555, resources[0].id); + EXPECT_EQ(444, resources[1].id); } else { - EXPECT_EQ(444u, resources[0].id); - EXPECT_EQ(555u, resources[1].id); + EXPECT_EQ(444, resources[0].id); + EXPECT_EQ(555, resources[1].id); } // The child compositor sends a frame before receiving an for the @@ -806,7 +806,7 @@ class LayerTreeHostDelegatedTestBadFrame // The bad frame's resource is given back to the child compositor. delegated_->TakeUnusedResourcesForChildCompositor(&resources); EXPECT_EQ(1u, resources.size()); - EXPECT_EQ(444u, resources[0].id); + EXPECT_EQ(444, resources[0].id); // Now send a good frame with 999 again. frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); @@ -817,7 +817,7 @@ class LayerTreeHostDelegatedTestBadFrame // The unused 555 from the last good frame is now released. delegated_->TakeUnusedResourcesForChildCompositor(&resources); EXPECT_EQ(1u, resources.size()); - EXPECT_EQ(555u, resources[0].id); + EXPECT_EQ(555, resources[0].id); EndTest(); break; @@ -928,7 +928,7 @@ class LayerTreeHostDelegatedTestUnnamedResource // The unused resource should be returned. delegated_->TakeUnusedResourcesForChildCompositor(&resources); EXPECT_EQ(1u, resources.size()); - EXPECT_EQ(999u, resources[0].id); + EXPECT_EQ(999, resources[0].id); EndTest(); break; @@ -991,7 +991,7 @@ class LayerTreeHostDelegatedTestDontLeakResource // The unused resource should be returned. delegated_->TakeUnusedResourcesForChildCompositor(&resources); EXPECT_EQ(1u, resources.size()); - EXPECT_EQ(999u, resources[0].id); + EXPECT_EQ(999, resources[0].id); EndTest(); break; @@ -1068,7 +1068,7 @@ class LayerTreeHostDelegatedTestResourceSentToParent // 999 was returned from the grandparent and could be released. delegated_->TakeUnusedResourcesForChildCompositor(&resources); EXPECT_EQ(1u, resources.size()); - EXPECT_EQ(999u, resources[0].id); + EXPECT_EQ(999, resources[0].id); EndTest(); break; @@ -1183,7 +1183,7 @@ class LayerTreeHostDelegatedTestCommitWithoutTake // 999 and 555 are in use, but 444 should be returned now. delegated_->TakeUnusedResourcesForChildCompositor(&resources); EXPECT_EQ(1u, resources.size()); - EXPECT_EQ(444u, resources[0].id); + EXPECT_EQ(444, resources[0].id); EndTest(); break; diff --git a/cc/trees/quad_culler.cc b/cc/trees/quad_culler.cc index 1609d18..b6fa5bc 100644 --- a/cc/trees/quad_culler.cc +++ b/cc/trees/quad_culler.cc @@ -24,9 +24,9 @@ QuadCuller::QuadCuller(QuadList* quad_list, bool for_surface) : quad_list_(quad_list), shared_quad_state_list_(shared_quad_state_list), + current_shared_quad_state_(NULL), layer_(layer), occlusion_tracker_(occlusion_tracker), - current_shared_quad_state_(NULL), show_culling_with_debug_border_quads_( show_culling_with_debug_border_quads), for_surface_(for_surface) {} diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index c5f9e94..e63a8fc 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc @@ -82,7 +82,7 @@ void SingleThreadProxy::FinishAllRendering() { bool SingleThreadProxy::IsStarted() const { DCHECK(Proxy::IsMainThread()); - return layer_tree_host_impl_; + return layer_tree_host_impl_.get(); } bool SingleThreadProxy::InitializeOutputSurface() { diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc index a09850a..8629701 100644 --- a/cc/trees/thread_proxy.cc +++ b/cc/trees/thread_proxy.cc @@ -340,7 +340,7 @@ void ThreadProxy::RequestVSyncNotification(VSyncClient* client) { TRACE_EVENT1( "cc", "ThreadProxy::RequestVSyncNotification", "enable", !!client); vsync_client_ = client; - layer_tree_host_impl_->EnableVSyncNotification(!!client); + layer_tree_host_impl_->EnableVSyncNotification(client); } void ThreadProxy::OnCanDrawStateChanged(bool can_draw) { |