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

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

Issue 2716733007: cc: Rename LayerImpl::render_surface to GetRenderSurface (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 3597 matching lines...) Expand 10 before | Expand all | Expand 10 after
3608 FakeLayerTreeHostImpl::RecursiveUpdateNumChildren( 3608 FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(
3609 *host_impl_->active_tree()->begin()); 3609 *host_impl_->active_tree()->begin());
3610 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); 3610 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3611 host_impl_->DrawLayers(&frame); 3611 host_impl_->DrawLayers(&frame);
3612 host_impl_->DidDrawAllLayers(frame); 3612 host_impl_->DidDrawAllLayers(frame);
3613 3613
3614 EXPECT_TRUE(root->did_draw_called()); 3614 EXPECT_TRUE(root->did_draw_called());
3615 EXPECT_TRUE(layer1->did_draw_called()); 3615 EXPECT_TRUE(layer1->did_draw_called());
3616 EXPECT_TRUE(layer2->did_draw_called()); 3616 EXPECT_TRUE(layer2->did_draw_called());
3617 3617
3618 EXPECT_NE(root->render_surface(), layer1->render_surface()); 3618 EXPECT_NE(root->GetRenderSurface(), layer1->GetRenderSurface());
3619 EXPECT_TRUE(layer1->render_surface()); 3619 EXPECT_TRUE(layer1->GetRenderSurface());
3620 } 3620 }
3621 3621
3622 class MissingTextureAnimatingLayer : public DidDrawCheckLayer { 3622 class MissingTextureAnimatingLayer : public DidDrawCheckLayer {
3623 public: 3623 public:
3624 static std::unique_ptr<LayerImpl> Create( 3624 static std::unique_ptr<LayerImpl> Create(
3625 LayerTreeImpl* tree_impl, 3625 LayerTreeImpl* tree_impl,
3626 int id, 3626 int id,
3627 bool tile_missing, 3627 bool tile_missing,
3628 bool had_incomplete_tile, 3628 bool had_incomplete_tile,
3629 bool animating, 3629 bool animating,
(...skipping 3250 matching lines...) Expand 10 before | Expand all | Expand 10 after
6880 PopulateSharedQuadState(shared_quad_state); 6880 PopulateSharedQuadState(shared_quad_state);
6881 6881
6882 TileDrawQuad* test_blending_draw_quad = 6882 TileDrawQuad* test_blending_draw_quad =
6883 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); 6883 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>();
6884 test_blending_draw_quad->SetNew(shared_quad_state, quad_rect_, opaque_rect, 6884 test_blending_draw_quad->SetNew(shared_quad_state, quad_rect_, opaque_rect,
6885 visible_quad_rect, resource_id_, 6885 visible_quad_rect, resource_id_,
6886 gfx::RectF(0.f, 0.f, 1.f, 1.f), 6886 gfx::RectF(0.f, 0.f, 1.f, 1.f),
6887 gfx::Size(1, 1), false, false); 6887 gfx::Size(1, 1), false, false);
6888 test_blending_draw_quad->visible_rect = quad_visible_rect_; 6888 test_blending_draw_quad->visible_rect = quad_visible_rect_;
6889 EXPECT_EQ(blend_, test_blending_draw_quad->ShouldDrawWithBlending()); 6889 EXPECT_EQ(blend_, test_blending_draw_quad->ShouldDrawWithBlending());
6890 EXPECT_EQ(has_render_surface_, !!render_surface()); 6890 EXPECT_EQ(has_render_surface_, !!GetRenderSurface());
6891 } 6891 }
6892 6892
6893 void SetExpectation(bool blend, bool has_render_surface) { 6893 void SetExpectation(bool blend, bool has_render_surface) {
6894 blend_ = blend; 6894 blend_ = blend;
6895 has_render_surface_ = has_render_surface; 6895 has_render_surface_ = has_render_surface;
6896 quads_appended_ = false; 6896 quads_appended_ = false;
6897 } 6897 }
6898 6898
6899 bool quads_appended() const { return quads_appended_; } 6899 bool quads_appended() const { return quads_appended_; }
6900 6900
(...skipping 4950 matching lines...) Expand 10 before | Expand all | Expand 10 after
11851 else 11851 else
11852 EXPECT_FALSE(tile->HasRasterTask()); 11852 EXPECT_FALSE(tile->HasRasterTask());
11853 } 11853 }
11854 Region expected_invalidation( 11854 Region expected_invalidation(
11855 raster_source->GetRectForImage(checkerable_image->uniqueID())); 11855 raster_source->GetRectForImage(checkerable_image->uniqueID()));
11856 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); 11856 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation()));
11857 } 11857 }
11858 11858
11859 } // namespace 11859 } // namespace
11860 } // namespace cc 11860 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698