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

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

Issue 1175113010: cc: Rename visible_content_rect and content stuff on quads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename-visible-content-rect: moreandroid Created 5 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
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_impl_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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 4786 matching lines...) Expand 10 before | Expand all | Expand 10 after
4797 float frame_scale = 0.f; 4797 float frame_scale = 0.f;
4798 RenderPass* root_pass = frame_data->render_passes.back(); 4798 RenderPass* root_pass = frame_data->render_passes.back();
4799 for (const auto& draw_quad : root_pass->quad_list) { 4799 for (const auto& draw_quad : root_pass->quad_list) {
4800 // Checkerboards mean an incomplete frame. 4800 // Checkerboards mean an incomplete frame.
4801 if (draw_quad->material != DrawQuad::TILED_CONTENT) 4801 if (draw_quad->material != DrawQuad::TILED_CONTENT)
4802 return 0.f; 4802 return 0.f;
4803 const TileDrawQuad* quad = TileDrawQuad::MaterialCast(draw_quad); 4803 const TileDrawQuad* quad = TileDrawQuad::MaterialCast(draw_quad);
4804 float quad_scale = 4804 float quad_scale =
4805 quad->tex_coord_rect.width() / static_cast<float>(quad->rect.width()); 4805 quad->tex_coord_rect.width() / static_cast<float>(quad->rect.width());
4806 float transform_scale = SkMScalarToFloat( 4806 float transform_scale = SkMScalarToFloat(
4807 quad->shared_quad_state->content_to_target_transform.matrix().get(0, 4807 quad->shared_quad_state->quad_to_target_transform.matrix().get(0, 0));
4808 0));
4809 float scale = quad_scale / transform_scale; 4808 float scale = quad_scale / transform_scale;
4810 if (frame_scale != 0.f && frame_scale != scale) 4809 if (frame_scale != 0.f && frame_scale != scale)
4811 return 0.f; 4810 return 0.f;
4812 frame_scale = scale; 4811 frame_scale = scale;
4813 } 4812 }
4814 return frame_scale; 4813 return frame_scale;
4815 } 4814 }
4816 4815
4817 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 4816 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
4818 4817
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
5099 float FrameQuadScaleDeltaFromIdeal(LayerTreeHostImpl::FrameData* frame_data) { 5098 float FrameQuadScaleDeltaFromIdeal(LayerTreeHostImpl::FrameData* frame_data) {
5100 if (frame_data->has_no_damage) 5099 if (frame_data->has_no_damage)
5101 return 0.f; 5100 return 0.f;
5102 float frame_scale = 0.f; 5101 float frame_scale = 0.f;
5103 RenderPass* root_pass = frame_data->render_passes.back(); 5102 RenderPass* root_pass = frame_data->render_passes.back();
5104 for (const auto& draw_quad : root_pass->quad_list) { 5103 for (const auto& draw_quad : root_pass->quad_list) {
5105 const TileDrawQuad* quad = TileDrawQuad::MaterialCast(draw_quad); 5104 const TileDrawQuad* quad = TileDrawQuad::MaterialCast(draw_quad);
5106 float quad_scale = 5105 float quad_scale =
5107 quad->tex_coord_rect.width() / static_cast<float>(quad->rect.width()); 5106 quad->tex_coord_rect.width() / static_cast<float>(quad->rect.width());
5108 float transform_scale = SkMScalarToFloat( 5107 float transform_scale = SkMScalarToFloat(
5109 quad->shared_quad_state->content_to_target_transform.matrix().get(0, 5108 quad->shared_quad_state->quad_to_target_transform.matrix().get(0, 0));
5110 0));
5111 float scale = quad_scale / transform_scale; 5109 float scale = quad_scale / transform_scale;
5112 if (frame_scale != 0.f && frame_scale != scale) 5110 if (frame_scale != 0.f && frame_scale != scale)
5113 return 0.f; 5111 return 0.f;
5114 frame_scale = scale; 5112 frame_scale = scale;
5115 } 5113 }
5116 return frame_scale; 5114 return frame_scale;
5117 } 5115 }
5118 5116
5119 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 5117 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
5120 5118
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
5961 5959
5962 scoped_refptr<FakePictureLayer> content_child_layer_; 5960 scoped_refptr<FakePictureLayer> content_child_layer_;
5963 FakeContentLayerClient client_; 5961 FakeContentLayerClient client_;
5964 }; 5962 };
5965 5963
5966 SINGLE_AND_MULTI_THREAD_TEST_F( 5964 SINGLE_AND_MULTI_THREAD_TEST_F(
5967 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild); 5965 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild);
5968 5966
5969 } // namespace 5967 } // namespace
5970 } // namespace cc 5968 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698