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

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

Issue 238753004: Vertical GlowEffect shown on about:blank page in low end devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "cc/animation/animation_registrar.h" 10 #include "cc/animation/animation_registrar.h"
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 } 1186 }
1187 // TODO(wjmaclean) Once we move to a model where the two-viewport model is 1187 // TODO(wjmaclean) Once we move to a model where the two-viewport model is
1188 // turned on in all builds, remove the next two lines. For now however, the 1188 // turned on in all builds, remove the next two lines. For now however, the
1189 // page scale layer may coincide with the clip layer, and so this is 1189 // page scale layer may coincide with the clip layer, and so this is
1190 // necessary. 1190 // necessary.
1191 if (page_scale_layer == scroll_clip_layer_) 1191 if (page_scale_layer == scroll_clip_layer_)
1192 scale_factor *= layer_tree_impl()->total_page_scale_factor(); 1192 scale_factor *= layer_tree_impl()->total_page_scale_factor();
1193 1193
1194 scaled_scroll_bounds.SetSize(scale_factor * scaled_scroll_bounds.width(), 1194 scaled_scroll_bounds.SetSize(scale_factor * scaled_scroll_bounds.width(),
1195 scale_factor * scaled_scroll_bounds.height()); 1195 scale_factor * scaled_scroll_bounds.height());
1196 scaled_scroll_bounds = gfx::ToFlooredSize(scaled_scroll_bounds);
1196 1197
1197 gfx::Vector2dF max_offset( 1198 gfx::Vector2dF max_offset(
1198 scaled_scroll_bounds.width() - scroll_clip_layer_->bounds().width(), 1199 scaled_scroll_bounds.width() - scroll_clip_layer_->bounds().width(),
1199 scaled_scroll_bounds.height() - scroll_clip_layer_->bounds().height()); 1200 scaled_scroll_bounds.height() - scroll_clip_layer_->bounds().height());
1200 // We need the final scroll offset to be in CSS coords. 1201 // We need the final scroll offset to be in CSS coords.
1201 max_offset.Scale(1 / scale_factor); 1202 max_offset.Scale(1 / scale_factor);
1202 max_offset.SetToMax(gfx::Vector2dF()); 1203 max_offset.SetToMax(gfx::Vector2dF());
1203 return gfx::ToFlooredVector2d(max_offset); 1204 return gfx::ToFlooredVector2d(max_offset);
aelias_OOO_until_Jul13 2014/04/16 22:25:43 There's already a floor here that's supposed to fi
1204 } 1205 }
1205 1206
1206 gfx::Vector2dF LayerImpl::ClampScrollToMaxScrollOffset() { 1207 gfx::Vector2dF LayerImpl::ClampScrollToMaxScrollOffset() {
1207 gfx::Vector2dF max_offset = MaxScrollOffset(); 1208 gfx::Vector2dF max_offset = MaxScrollOffset();
1208 gfx::Vector2dF old_offset = TotalScrollOffset(); 1209 gfx::Vector2dF old_offset = TotalScrollOffset();
1209 gfx::Vector2dF clamped_offset = old_offset; 1210 gfx::Vector2dF clamped_offset = old_offset;
1210 1211
1211 clamped_offset.SetToMin(max_offset); 1212 clamped_offset.SetToMin(max_offset);
1212 clamped_offset.SetToMax(gfx::Vector2d()); 1213 clamped_offset.SetToMax(gfx::Vector2d());
1213 gfx::Vector2dF delta = clamped_offset - old_offset; 1214 gfx::Vector2dF delta = clamped_offset - old_offset;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 scoped_ptr<base::Value> LayerImpl::AsValue() const { 1501 scoped_ptr<base::Value> LayerImpl::AsValue() const {
1501 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1502 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1502 AsValueInto(state.get()); 1503 AsValueInto(state.get());
1503 return state.PassAs<base::Value>(); 1504 return state.PassAs<base::Value>();
1504 } 1505 }
1505 1506
1506 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { 1507 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
1507 benchmark->RunOnLayer(this); 1508 benchmark->RunOnLayer(this);
1508 } 1509 }
1509 } // namespace cc 1510 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698