diff options
26 files changed, 76 insertions, 76 deletions
diff --git a/cc/layers/delegated_renderer_layer_impl.cc b/cc/layers/delegated_renderer_layer_impl.cc index d050333..dbc67dc 100644 --- a/cc/layers/delegated_renderer_layer_impl.cc +++ b/cc/layers/delegated_renderer_layer_impl.cc @@ -366,7 +366,7 @@ void DelegatedRendererLayerImpl::AppendRainbowDebugBorder( scoped_ptr<SolidColorDrawQuad> top_quad = SolidColorDrawQuad::Create(); top_quad->SetNew( shared_quad_state, top, top, colors[i % kNumColors], false); - quad_sink->Append(top_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(top_quad.PassAs<DrawQuad>()); scoped_ptr<SolidColorDrawQuad> bottom_quad = SolidColorDrawQuad::Create(); bottom_quad->SetNew(shared_quad_state, @@ -374,7 +374,7 @@ void DelegatedRendererLayerImpl::AppendRainbowDebugBorder( bottom, colors[kNumColors - 1 - (i % kNumColors)], false); - quad_sink->Append(bottom_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(bottom_quad.PassAs<DrawQuad>()); } if (!left.IsEmpty()) { scoped_ptr<SolidColorDrawQuad> left_quad = SolidColorDrawQuad::Create(); @@ -383,12 +383,12 @@ void DelegatedRendererLayerImpl::AppendRainbowDebugBorder( left, colors[kNumColors - 1 - (i % kNumColors)], false); - quad_sink->Append(left_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(left_quad.PassAs<DrawQuad>()); scoped_ptr<SolidColorDrawQuad> right_quad = SolidColorDrawQuad::Create(); right_quad->SetNew( shared_quad_state, right, right, colors[i % kNumColors], false); - quad_sink->Append(right_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(right_quad.PassAs<DrawQuad>()); } } } @@ -471,7 +471,7 @@ void DelegatedRendererLayerImpl::AppendRenderPassQuads( } if (output_quad) - quad_sink->Append(output_quad.Pass()); + quad_sink->MaybeAppend(output_quad.Pass()); } } diff --git a/cc/layers/delegated_renderer_layer_impl_unittest.cc b/cc/layers/delegated_renderer_layer_impl_unittest.cc index 84a862f..e45128b 100644 --- a/cc/layers/delegated_renderer_layer_impl_unittest.cc +++ b/cc/layers/delegated_renderer_layer_impl_unittest.cc @@ -555,7 +555,7 @@ class DelegatedRendererLayerImplTestTransform gfx::Rect(20, 20, 3, 7), 1u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); color_quad = SolidColorDrawQuad::Create(); color_quad->SetNew(shared_quad_state, @@ -563,7 +563,7 @@ class DelegatedRendererLayerImplTestTransform gfx::Rect(23, 20, 4, 7), 1u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); } gfx::Size root_pass_content_bounds(100, 100); @@ -603,7 +603,7 @@ class DelegatedRendererLayerImplTestTransform gfx::RectF(), // mask_uv_rect FilterOperations(), // filters FilterOperations()); // background_filters - quad_sink.Append(render_pass_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(render_pass_quad.PassAs<DrawQuad>()); scoped_ptr<SolidColorDrawQuad> color_quad; color_quad = SolidColorDrawQuad::Create(); @@ -612,7 +612,7 @@ class DelegatedRendererLayerImplTestTransform gfx::Rect(0, 0, 10, 10), 1u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); color_quad = SolidColorDrawQuad::Create(); color_quad->SetNew(shared_quad_state, @@ -620,7 +620,7 @@ class DelegatedRendererLayerImplTestTransform gfx::Rect(0, 10, 10, 10), 2u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); color_quad = SolidColorDrawQuad::Create(); color_quad->SetNew(shared_quad_state, @@ -628,7 +628,7 @@ class DelegatedRendererLayerImplTestTransform gfx::Rect(10, 0, 10, 10), 3u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); color_quad = SolidColorDrawQuad::Create(); color_quad->SetNew(shared_quad_state, @@ -636,7 +636,7 @@ class DelegatedRendererLayerImplTestTransform gfx::Rect(10, 10, 10, 10), 4u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); delegated_renderer_layer->SetFrameDataForRenderPasses( &delegated_render_passes); @@ -986,7 +986,7 @@ class DelegatedRendererLayerImplTestClip gfx::Rect(20, 20, 3, 7), 1u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); color_quad = SolidColorDrawQuad::Create(); color_quad->SetNew(shared_quad_state, @@ -994,7 +994,7 @@ class DelegatedRendererLayerImplTestClip gfx::Rect(23, 20, 4, 7), 1u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); } gfx::Size root_pass_content_bounds(50, 50); @@ -1032,7 +1032,7 @@ class DelegatedRendererLayerImplTestClip gfx::RectF(), // mask_uv_rect FilterOperations(), // filters FilterOperations()); // background_filters - quad_sink.Append(render_pass_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(render_pass_quad.PassAs<DrawQuad>()); scoped_ptr<SolidColorDrawQuad> color_quad; color_quad = SolidColorDrawQuad::Create(); @@ -1041,7 +1041,7 @@ class DelegatedRendererLayerImplTestClip gfx::Rect(0, 0, 10, 10), 1u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); color_quad = SolidColorDrawQuad::Create(); color_quad->SetNew(shared_quad_state, @@ -1049,7 +1049,7 @@ class DelegatedRendererLayerImplTestClip gfx::Rect(0, 10, 10, 10), 2u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); color_quad = SolidColorDrawQuad::Create(); color_quad->SetNew(shared_quad_state, @@ -1057,7 +1057,7 @@ class DelegatedRendererLayerImplTestClip gfx::Rect(10, 0, 10, 10), 3u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); color_quad = SolidColorDrawQuad::Create(); color_quad->SetNew(shared_quad_state, @@ -1065,7 +1065,7 @@ class DelegatedRendererLayerImplTestClip gfx::Rect(10, 10, 10, 10), 4u, false); - quad_sink.Append(color_quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(color_quad.PassAs<DrawQuad>()); delegated_renderer_layer->SetFrameDataForRenderPasses( &delegated_render_passes); diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc index c6ed5fc..9c544f3 100644 --- a/cc/layers/heads_up_display_layer_impl.cc +++ b/cc/layers/heads_up_display_layer_impl.cc @@ -133,7 +133,7 @@ void HeadsUpDisplayLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } void HeadsUpDisplayLayerImpl::UpdateHudTexture( diff --git a/cc/layers/io_surface_layer_impl.cc b/cc/layers/io_surface_layer_impl.cc index 2b842d3..4287978 100644 --- a/cc/layers/io_surface_layer_impl.cc +++ b/cc/layers/io_surface_layer_impl.cc @@ -122,7 +122,7 @@ void IOSurfaceLayerImpl::AppendQuads(QuadSink* quad_sink, io_surface_size_, io_surface_resource_id_, IOSurfaceDrawQuad::FLIPPED); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } void IOSurfaceLayerImpl::ReleaseResources() { diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index 6aaccc2..363bffb 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -310,7 +310,7 @@ void LayerImpl::AppendDebugBorderQuad(QuadSink* quad_sink, DebugBorderDrawQuad::Create(); debug_border_quad->SetNew( shared_quad_state, quad_rect, visible_quad_rect, color, width); - quad_sink->Append(debug_border_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(debug_border_quad.PassAs<DrawQuad>()); } bool LayerImpl::HasDelegatedContent() const { diff --git a/cc/layers/nine_patch_layer_impl.cc b/cc/layers/nine_patch_layer_impl.cc index c3cefb6..e90de16 100644 --- a/cc/layers/nine_patch_layer_impl.cc +++ b/cc/layers/nine_patch_layer_impl.cc @@ -232,7 +232,7 @@ void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); quad = TextureDrawQuad::Create(); quad->SetNew(shared_quad_state, @@ -246,7 +246,7 @@ void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); quad = TextureDrawQuad::Create(); quad->SetNew(shared_quad_state, @@ -260,7 +260,7 @@ void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); quad = TextureDrawQuad::Create(); quad->SetNew(shared_quad_state, @@ -274,7 +274,7 @@ void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); quad = TextureDrawQuad::Create(); quad->SetNew(shared_quad_state, @@ -288,7 +288,7 @@ void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); quad = TextureDrawQuad::Create(); quad->SetNew(shared_quad_state, @@ -302,7 +302,7 @@ void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); quad = TextureDrawQuad::Create(); quad->SetNew(shared_quad_state, @@ -316,7 +316,7 @@ void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); quad = TextureDrawQuad::Create(); quad->SetNew(shared_quad_state, @@ -330,7 +330,7 @@ void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); if (fill_center_) { quad = TextureDrawQuad::Create(); @@ -345,7 +345,7 @@ void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } } diff --git a/cc/layers/painted_scrollbar_layer_impl.cc b/cc/layers/painted_scrollbar_layer_impl.cc index bd992e9..25138ca 100644 --- a/cc/layers/painted_scrollbar_layer_impl.cc +++ b/cc/layers/painted_scrollbar_layer_impl.cc @@ -105,7 +105,7 @@ void PaintedScrollbarLayerImpl::AppendQuads( SK_ColorTRANSPARENT, opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } gfx::Rect track_quad_rect = content_bounds_rect; @@ -125,7 +125,7 @@ void PaintedScrollbarLayerImpl::AppendQuads( SK_ColorTRANSPARENT, opacity, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } } diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc index 91128e9..735e4a4 100644 --- a/cc/layers/picture_layer_impl.cc +++ b/cc/layers/picture_layer_impl.cc @@ -157,7 +157,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, quad_content_rect, contents_scale, pile_); - if (quad_sink->Append(quad.PassAs<DrawQuad>())) + if (quad_sink->MaybeAppend(quad.PassAs<DrawQuad>())) append_quads_data->num_missing_tiles++; return; } @@ -207,7 +207,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, visible_geometry_rect, color, width); - quad_sink->Append(debug_border_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(debug_border_quad.PassAs<DrawQuad>()); } } @@ -228,7 +228,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, SkColor color = DebugColors::DefaultCheckerboardColor(); quad->SetNew( shared_quad_state, geometry_rect, visible_geometry_rect, color); - if (quad_sink->Append(quad.PassAs<DrawQuad>())) + if (quad_sink->MaybeAppend(quad.PassAs<DrawQuad>())) append_quads_data->num_missing_tiles++; } else { SkColor color = SafeOpaqueBackgroundColor(); @@ -238,7 +238,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, visible_geometry_rect, color, false); - if (quad_sink->Append(quad.PassAs<DrawQuad>())) + if (quad_sink->MaybeAppend(quad.PassAs<DrawQuad>())) append_quads_data->num_missing_tiles++; } @@ -306,7 +306,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, } DCHECK(draw_quad); - quad_sink->Append(draw_quad.Pass()); + quad_sink->MaybeAppend(draw_quad.Pass()); if (seen_tilings.empty() || seen_tilings.back() != iter.CurrentTiling()) seen_tilings.push_back(iter.CurrentTiling()); diff --git a/cc/layers/quad_sink.h b/cc/layers/quad_sink.h index 8be2881..42c9902 100644 --- a/cc/layers/quad_sink.h +++ b/cc/layers/quad_sink.h @@ -25,7 +25,7 @@ class CC_EXPORT QuadSink { // Returns true if the quad is added to the list, and false if the quad is // entirely culled. - virtual bool Append(scoped_ptr<DrawQuad> draw_quad) = 0; + virtual bool MaybeAppend(scoped_ptr<DrawQuad> draw_quad) = 0; }; } // namespace cc diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc index 187f603..9a1edbf 100644 --- a/cc/layers/render_surface_impl.cc +++ b/cc/layers/render_surface_impl.cc @@ -168,7 +168,7 @@ void RenderSurfaceImpl::AppendQuads(QuadSink* quad_sink, DebugBorderDrawQuad::Create(); debug_border_quad->SetNew( shared_quad_state, quad_rect, visible_quad_rect, color, width); - quad_sink->Append(debug_border_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(debug_border_quad.PassAs<DrawQuad>()); } // TODO(shawnsingh): By using the same RenderSurfaceImpl for both the content @@ -229,7 +229,7 @@ void RenderSurfaceImpl::AppendQuads(QuadSink* quad_sink, mask_uv_rect, owning_layer_->filters(), owning_layer_->background_filters()); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } } // namespace cc diff --git a/cc/layers/solid_color_layer_impl.cc b/cc/layers/solid_color_layer_impl.cc index 19575e3..1dd696d 100644 --- a/cc/layers/solid_color_layer_impl.cc +++ b/cc/layers/solid_color_layer_impl.cc @@ -45,7 +45,7 @@ void SolidColorLayerImpl::AppendQuads(QuadSink* quad_sink, visible_quad_rect, background_color(), false); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } } } diff --git a/cc/layers/solid_color_scrollbar_layer_impl.cc b/cc/layers/solid_color_scrollbar_layer_impl.cc index 692f693..395cca2 100644 --- a/cc/layers/solid_color_scrollbar_layer_impl.cc +++ b/cc/layers/solid_color_scrollbar_layer_impl.cc @@ -101,7 +101,7 @@ void SolidColorScrollbarLayerImpl::AppendQuads(QuadSink* quad_sink, scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); quad->SetNew( shared_quad_state, thumb_quad_rect, visible_quad_rect, color_, false); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } } // namespace cc diff --git a/cc/layers/surface_layer_impl.cc b/cc/layers/surface_layer_impl.cc index b1739c3..ffeae2a 100644 --- a/cc/layers/surface_layer_impl.cc +++ b/cc/layers/surface_layer_impl.cc @@ -48,7 +48,7 @@ void SurfaceLayerImpl::AppendQuads(QuadSink* quad_sink, gfx::Rect quad_rect(content_bounds()); gfx::Rect visible_quad_rect(quad_rect); quad->SetNew(shared_quad_state, quad_rect, visible_quad_rect, surface_id_); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } void SurfaceLayerImpl::GetDebugBorderProperties(SkColor* color, diff --git a/cc/layers/texture_layer_impl.cc b/cc/layers/texture_layer_impl.cc index bba5f2d..9e5b108 100644 --- a/cc/layers/texture_layer_impl.cc +++ b/cc/layers/texture_layer_impl.cc @@ -187,7 +187,7 @@ void TextureLayerImpl::AppendQuads(QuadSink* quad_sink, bg_color, vertex_opacity_, flipped_); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } void TextureLayerImpl::DidDraw(ResourceProvider* resource_provider) { diff --git a/cc/layers/tiled_layer_impl.cc b/cc/layers/tiled_layer_impl.cc index da23e52..3b84a5c 100644 --- a/cc/layers/tiled_layer_impl.cc +++ b/cc/layers/tiled_layer_impl.cc @@ -188,7 +188,7 @@ void TiledLayerImpl::AppendQuads(QuadSink* quad_sink, visible_tile_rect, border_color, border_width); - quad_sink->Append(debug_border_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(debug_border_quad.PassAs<DrawQuad>()); } } } @@ -222,7 +222,7 @@ void TiledLayerImpl::AppendQuads(QuadSink* quad_sink, CheckerboardDrawQuad::Create(); checkerboard_quad->SetNew( shared_quad_state, tile_rect, visible_tile_rect, checker_color); - if (quad_sink->Append(checkerboard_quad.PassAs<DrawQuad>())) + if (quad_sink->MaybeAppend(checkerboard_quad.PassAs<DrawQuad>())) append_quads_data->num_missing_tiles++; continue; @@ -252,7 +252,7 @@ void TiledLayerImpl::AppendQuads(QuadSink* quad_sink, tex_coord_rect, texture_size, tile->contents_swizzled()); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } } } diff --git a/cc/layers/ui_resource_layer_impl.cc b/cc/layers/ui_resource_layer_impl.cc index 8b8f97d..2a975314 100644 --- a/cc/layers/ui_resource_layer_impl.cc +++ b/cc/layers/ui_resource_layer_impl.cc @@ -129,7 +129,7 @@ void UIResourceLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, vertex_opacity_, flipped); - quad_sink->Append(quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(quad.PassAs<DrawQuad>()); } const char* UIResourceLayerImpl::LayerTypeAsString() const { diff --git a/cc/layers/video_layer_impl.cc b/cc/layers/video_layer_impl.cc index 9fea5fd..023b5ba 100644 --- a/cc/layers/video_layer_impl.cc +++ b/cc/layers/video_layer_impl.cc @@ -168,7 +168,7 @@ void VideoLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, opacity, flipped); - quad_sink->Append(texture_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(texture_quad.PassAs<DrawQuad>()); break; } case VideoFrameExternalResources::YUV_RESOURCE: { @@ -187,7 +187,7 @@ void VideoLayerImpl::AppendQuads(QuadSink* quad_sink, frame_resources_[1], frame_resources_[2], frame_resources_.size() > 3 ? frame_resources_[3] : 0); - quad_sink->Append(yuv_video_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(yuv_video_quad.PassAs<DrawQuad>()); break; } case VideoFrameExternalResources::RGB_RESOURCE: { @@ -211,7 +211,7 @@ void VideoLayerImpl::AppendQuads(QuadSink* quad_sink, SK_ColorTRANSPARENT, opacity, flipped); - quad_sink->Append(texture_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(texture_quad.PassAs<DrawQuad>()); break; } case VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE: { @@ -229,7 +229,7 @@ void VideoLayerImpl::AppendQuads(QuadSink* quad_sink, visible_quad_rect, frame_resources_[0], scale * provider_client_impl_->stream_texture_matrix()); - quad_sink->Append(stream_video_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(stream_video_quad.PassAs<DrawQuad>()); break; } case VideoFrameExternalResources::IO_SURFACE: { @@ -246,7 +246,7 @@ void VideoLayerImpl::AppendQuads(QuadSink* quad_sink, visible_size, frame_resources_[0], IOSurfaceDrawQuad::UNFLIPPED); - quad_sink->Append(io_surface_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(io_surface_quad.PassAs<DrawQuad>()); break; } #if defined(VIDEO_HOLE) @@ -266,8 +266,8 @@ void VideoLayerImpl::AppendQuads(QuadSink* quad_sink, solid_color_draw_quad->SetAll( shared_quad_state, quad_rect, quad_rect, quad_rect, false, SK_ColorTRANSPARENT, true); - quad_sink->Append(solid_color_draw_quad.PassAs<DrawQuad>(), - append_quads_data); + quad_sink->MaybeAppend(solid_color_draw_quad.PassAs<DrawQuad>(), + append_quads_data); break; } #endif // defined(VIDEO_HOLE) diff --git a/cc/surfaces/surface_aggregator_test_helpers.cc b/cc/surfaces/surface_aggregator_test_helpers.cc index 2ac3289..cc14dde 100644 --- a/cc/surfaces/surface_aggregator_test_helpers.cc +++ b/cc/surfaces/surface_aggregator_test_helpers.cc @@ -76,7 +76,7 @@ void AddTestRenderPassQuad(TestRenderPass* pass, gfx::RectF(), FilterOperations(), FilterOperations()); - quad_sink.Append(quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(quad.PassAs<DrawQuad>()); } void AddQuadInPass(TestRenderPass* pass, Quad desc) { diff --git a/cc/test/mock_quad_culler.cc b/cc/test/mock_quad_culler.cc index 7bf70b7..d3fed900 100644 --- a/cc/test/mock_quad_culler.cc +++ b/cc/test/mock_quad_culler.cc @@ -20,7 +20,7 @@ MockQuadCuller::MockQuadCuller( MockQuadCuller::~MockQuadCuller() {} -bool MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { +bool MockQuadCuller::MaybeAppend(scoped_ptr<DrawQuad> draw_quad) { if (!draw_quad->rect.IsEmpty()) { active_quad_list_->push_back(draw_quad.Pass()); return true; diff --git a/cc/test/mock_quad_culler.h b/cc/test/mock_quad_culler.h index 238f187..103b63d 100644 --- a/cc/test/mock_quad_culler.h +++ b/cc/test/mock_quad_culler.h @@ -21,7 +21,7 @@ class MockQuadCuller : public QuadSink { SharedQuadStateList* external_shared_quad_state_list); // QuadSink interface. - virtual bool Append(scoped_ptr<DrawQuad> draw_quad) OVERRIDE; + virtual bool MaybeAppend(scoped_ptr<DrawQuad> draw_quad) OVERRIDE; virtual SharedQuadState* UseSharedQuadState( scoped_ptr<SharedQuadState> shared_quad_state) OVERRIDE; diff --git a/cc/test/render_pass_test_utils.cc b/cc/test/render_pass_test_utils.cc index 8d0d955..679ce19 100644 --- a/cc/test/render_pass_test_utils.cc +++ b/cc/test/render_pass_test_utils.cc @@ -44,7 +44,7 @@ SolidColorDrawQuad* AddQuad(TestRenderPass* pass, scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); quad->SetNew(shared_state, rect, rect, color, false); SolidColorDrawQuad* quad_ptr = quad.get(); - quad_sink.Append(quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(quad.PassAs<DrawQuad>()); return quad_ptr; } @@ -64,7 +64,7 @@ SolidColorDrawQuad* AddClippedQuad(TestRenderPass* pass, scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); quad->SetNew(shared_state, rect, rect, color, false); SolidColorDrawQuad* quad_ptr = quad.get(); - quad_sink.Append(quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(quad.PassAs<DrawQuad>()); return quad_ptr; } @@ -80,7 +80,7 @@ SolidColorDrawQuad* AddTransformedQuad(TestRenderPass* pass, scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); quad->SetNew(shared_state, rect, rect, color, false); SolidColorDrawQuad* quad_ptr = quad.get(); - quad_sink.Append(quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(quad.PassAs<DrawQuad>()); return quad_ptr; } @@ -109,7 +109,7 @@ void AddRenderPassQuad(TestRenderPass* to_pass, gfx::RectF(), FilterOperations(), FilterOperations()); - quad_sink.Append(quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(quad.PassAs<DrawQuad>()); } void AddRenderPassQuad(TestRenderPass* to_pass, @@ -140,7 +140,7 @@ void AddRenderPassQuad(TestRenderPass* to_pass, gfx::RectF(), filters, FilterOperations()); - quad_sink.Append(quad.PassAs<DrawQuad>()); + quad_sink.MaybeAppend(quad.PassAs<DrawQuad>()); } } // namespace cc diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 0aa9921..7bc188d 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -665,7 +665,7 @@ static void AppendQuadsToFillScreen( visible_screen_space_rect, screen_background_color, false); - quad_culler.Append(quad.PassAs<DrawQuad>()); + quad_culler.MaybeAppend(quad.PassAs<DrawQuad>()); } for (Region::Iterator fill_rects(overhang_region); fill_rects.has_rect(); @@ -693,7 +693,7 @@ static void AppendQuadsToFillScreen( screen_background_color, vertex_opacity, false); - quad_culler.Append(tex_quad.PassAs<DrawQuad>()); + quad_culler.MaybeAppend(tex_quad.PassAs<DrawQuad>()); } } diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index a652c94..e62c532 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -3186,7 +3186,7 @@ class BlendStateCheckLayer : public LayerImpl { test_blending_draw_quad->visible_rect = quad_visible_rect_; EXPECT_EQ(blend_, test_blending_draw_quad->ShouldDrawWithBlending()); EXPECT_EQ(has_render_surface_, !!render_surface()); - quad_sink->Append(test_blending_draw_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(test_blending_draw_quad.PassAs<DrawQuad>()); } void SetExpectation(bool blend, bool has_render_surface) { @@ -3960,7 +3960,7 @@ class FakeLayerWithQuads : public LayerImpl { scoped_ptr<SolidColorDrawQuad> my_quad = SolidColorDrawQuad::Create(); my_quad->SetNew( shared_quad_state, quad_rect, visible_quad_rect, gray, false); - quad_sink->Append(my_quad.PassAs<DrawQuad>()); + quad_sink->MaybeAppend(my_quad.PassAs<DrawQuad>()); } private: diff --git a/cc/trees/quad_culler.cc b/cc/trees/quad_culler.cc index b4ab693..f47400e 100644 --- a/cc/trees/quad_culler.cc +++ b/cc/trees/quad_culler.cc @@ -72,7 +72,7 @@ static inline bool AppendQuadInternal( return keep_quad; } -bool QuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { +bool QuadCuller::MaybeAppend(scoped_ptr<DrawQuad> draw_quad) { DCHECK(draw_quad->shared_quad_state == current_shared_quad_state_); DCHECK(!shared_quad_state_list_->empty()); DCHECK(shared_quad_state_list_->back() == current_shared_quad_state_); diff --git a/cc/trees/quad_culler.h b/cc/trees/quad_culler.h index 7fdf5e8..22d3790 100644 --- a/cc/trees/quad_culler.h +++ b/cc/trees/quad_culler.h @@ -28,7 +28,7 @@ class CC_EXPORT QuadCuller : public QuadSink { // QuadSink implementation. virtual SharedQuadState* UseSharedQuadState( scoped_ptr<SharedQuadState> shared_quad_state) OVERRIDE; - virtual bool Append(scoped_ptr<DrawQuad> draw_quad) OVERRIDE; + virtual bool MaybeAppend(scoped_ptr<DrawQuad> draw_quad) OVERRIDE; private: QuadList* quad_list_; diff --git a/cc/trees/quad_culler_unittest.cc b/cc/trees/quad_culler_unittest.cc index 08195e6..6a13ac5 100644 --- a/cc/trees/quad_culler_unittest.cc +++ b/cc/trees/quad_culler_unittest.cc @@ -689,9 +689,9 @@ TEST_F(QuadCullerTest, PartialCullingNotDestroyed) { EXPECT_EQ(0u, quad_list.size()); - culler.Append(color_quad.PassAs<DrawQuad>()); - culler.Append(pass_quad.PassAs<DrawQuad>()); - culler.Append(replica_quad.PassAs<DrawQuad>()); + culler.MaybeAppend(color_quad.PassAs<DrawQuad>()); + culler.MaybeAppend(pass_quad.PassAs<DrawQuad>()); + culler.MaybeAppend(replica_quad.PassAs<DrawQuad>()); ASSERT_EQ(3u, quad_list.size()); @@ -766,9 +766,9 @@ TEST_F(QuadCullerTest, PartialCullingWithOcclusionNotDestroyed) { EXPECT_EQ(0u, quad_list.size()); - culler.Append(color_quad.PassAs<DrawQuad>()); - culler.Append(pass_quad.PassAs<DrawQuad>()); - culler.Append(replica_quad.PassAs<DrawQuad>()); + culler.MaybeAppend(color_quad.PassAs<DrawQuad>()); + culler.MaybeAppend(pass_quad.PassAs<DrawQuad>()); + culler.MaybeAppend(replica_quad.PassAs<DrawQuad>()); ASSERT_EQ(3u, quad_list.size()); |