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

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

Issue 2795963002: cc: Reduce surface contents scale adjustments. (Closed)
Patch Set: apply scale for copy requests Created 3 years, 8 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 | « no previous file | cc/test/layer_tree_pixel_test.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/render_surface_impl.h" 5 #include "cc/layers/render_surface_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/layers/append_quads_data.h" 9 #include "cc/layers/append_quads_data.h"
10 #include "cc/quads/render_pass_draw_quad.h" 10 #include "cc/quads/render_pass_draw_quad.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 EXPECT_EQ(1u, partially_occluded_count); 65 EXPECT_EQ(1u, partially_occluded_count);
66 } 66 }
67 } 67 }
68 68
69 TEST(RenderSurfaceLayerImplTest, AppendQuadsWithScaledMask) { 69 TEST(RenderSurfaceLayerImplTest, AppendQuadsWithScaledMask) {
70 gfx::Size layer_size(1000, 1000); 70 gfx::Size layer_size(1000, 1000);
71 gfx::Size viewport_size(1000, 1000); 71 gfx::Size viewport_size(1000, 1000);
72 scoped_refptr<FakeRasterSource> raster_source = 72 scoped_refptr<FakeRasterSource> raster_source =
73 FakeRasterSource::CreateFilledSolidColor(layer_size); 73 FakeRasterSource::CreateFilledSolidColor(layer_size);
74 74
75 LayerTestCommon::LayerImplTest impl; 75 LayerTreeSettings settings;
76 settings.layer_transforms_should_scale_layer_contents = true;
77 LayerTestCommon::LayerImplTest impl(settings);
76 std::unique_ptr<LayerImpl> root = 78 std::unique_ptr<LayerImpl> root =
77 LayerImpl::Create(impl.host_impl()->active_tree(), 2); 79 LayerImpl::Create(impl.host_impl()->active_tree(), 2);
78 std::unique_ptr<LayerImpl> surface = 80 std::unique_ptr<LayerImpl> surface =
79 LayerImpl::Create(impl.host_impl()->active_tree(), 3); 81 LayerImpl::Create(impl.host_impl()->active_tree(), 3);
80 surface->SetBounds(layer_size); 82 surface->SetBounds(layer_size);
81 surface->test_properties()->force_render_surface = true; 83 surface->test_properties()->force_render_surface = true;
82 84
83 gfx::Transform scale; 85 gfx::Transform scale;
84 scale.Scale(2, 2); 86 scale.Scale(2, 2);
85 surface->test_properties()->transform = scale; 87 surface->test_properties()->transform = scale;
(...skipping 29 matching lines...) Expand all
115 117
116 DCHECK(render_pass->quad_list.front()); 118 DCHECK(render_pass->quad_list.front());
117 const RenderPassDrawQuad* quad = 119 const RenderPassDrawQuad* quad =
118 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); 120 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front());
119 EXPECT_EQ(gfx::RectF(0, 0, 1, 1), quad->mask_uv_rect); 121 EXPECT_EQ(gfx::RectF(0, 0, 1, 1), quad->mask_uv_rect);
120 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); 122 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale);
121 } 123 }
122 124
123 } // namespace 125 } // namespace
124 } // namespace cc 126 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/layer_tree_pixel_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698