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

Side by Side Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 16211002: Skip drawing unsupported layers in forced software mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on r203584 Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/layers/append_quads_data.h" 9 #include "cc/layers/append_quads_data.h"
10 #include "cc/layers/picture_layer.h" 10 #include "cc/layers/picture_layer.h"
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 793
794 active_layer_->SetContentBounds(layer_bounds); 794 active_layer_->SetContentBounds(layer_bounds);
795 active_layer_->draw_properties().visible_content_rect = 795 active_layer_->draw_properties().visible_content_rect =
796 gfx::Rect(layer_bounds); 796 gfx::Rect(layer_bounds);
797 797
798 gfx::Rect layer_invalidation(150, 200, 30, 180); 798 gfx::Rect layer_invalidation(150, 200, 30, 180);
799 Region invalidation(layer_invalidation); 799 Region invalidation(layer_invalidation);
800 AddDefaultTilingsWithInvalidation(invalidation); 800 AddDefaultTilingsWithInvalidation(invalidation);
801 801
802 AppendQuadsData data; 802 AppendQuadsData data;
803 data.allow_tile_draw_quads = false; 803 active_layer_->WillDraw(DRAW_MODE_RESOURCELESS_SOFTWARE, NULL);
804 active_layer_->AppendQuads(&quad_culler, &data); 804 active_layer_->AppendQuads(&quad_culler, &data);
805 active_layer_->DidDraw(NULL);
805 806
806 ASSERT_EQ(1U, quad_culler.quad_list().size()); 807 ASSERT_EQ(1U, quad_culler.quad_list().size());
807 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, quad_culler.quad_list()[0]->material); 808 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, quad_culler.quad_list()[0]->material);
808 } 809 }
809 810
810 TEST_F(PictureLayerImplTest, MarkRequiredNullTiles) { 811 TEST_F(PictureLayerImplTest, MarkRequiredNullTiles) {
811 gfx::Size tile_size(100, 100); 812 gfx::Size tile_size(100, 100);
812 gfx::Size layer_bounds(1000, 1000); 813 gfx::Size layer_bounds(1000, 1000);
813 814
814 scoped_refptr<FakePicturePileImpl> pending_pile = 815 scoped_refptr<FakePicturePileImpl> pending_pile =
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 num_offscreen++; 888 num_offscreen++;
888 } 889 }
889 } 890 }
890 891
891 EXPECT_GT(num_visible, 0); 892 EXPECT_GT(num_visible, 0);
892 EXPECT_GT(num_offscreen, 0); 893 EXPECT_GT(num_offscreen, 0);
893 } 894 }
894 895
895 } // namespace 896 } // namespace
896 } // namespace cc 897 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698