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

Unified Diff: chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.cc

Issue 2566753004: Simplify content_layer attachment and viewporting logic. (Closed)
Patch Set: Code review Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.cc
diff --git a/chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.cc b/chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.cc
index e407884a7012db2d04819abbf18a4eff8fb98f45..948126e74a8b3247d299dcbbf1be53ab24dbe70b 100644
--- a/chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.cc
+++ b/chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.cc
@@ -39,10 +39,6 @@ SkColor StaticTabSceneLayer::GetBackgroundColor() {
void StaticTabSceneLayer::UpdateTabLayer(
JNIEnv* env,
const JavaParamRef<jobject>& jobj,
- jfloat content_viewport_x,
- jfloat content_viewport_y,
- jfloat content_viewport_width,
- jfloat content_viewport_height,
const JavaParamRef<jobject>& jtab_content_manager,
jint id,
jint toolbar_resource_id,
@@ -50,16 +46,10 @@ void StaticTabSceneLayer::UpdateTabLayer(
jint default_background_color,
jfloat x,
jfloat y,
- jfloat width,
- jfloat height,
- jfloat content_offset_y,
jfloat static_to_view_blend,
jfloat saturation,
jfloat brightness) {
background_color_ = default_background_color;
- gfx::Size content_viewport_size(content_viewport_width,
- content_viewport_height);
- gfx::Point content_viewport_offset(content_viewport_x, content_viewport_y);
if (!content_layer_.get()) {
android::TabContentManager* tab_content_manager =
android::TabContentManager::FromJavaObject(jtab_content_manager);
@@ -73,40 +63,10 @@ void StaticTabSceneLayer::UpdateTabLayer(
bool should_override_content_alpha = last_set_tab_id_ != id;
last_set_tab_id_ = id;
- // Set up the content layer and move it to the proper position.
- content_layer_->layer()->SetBounds(gfx::Size(width, height));
- content_layer_->layer()->SetPosition(gfx::PointF(x, y));
content_layer_->SetProperties(
id, can_use_live_layer, static_to_view_blend,
should_override_content_alpha, content_alpha_override, saturation,
- gfx::Rect(content_viewport_size), content_viewport_size);
-
- gfx::Size content_bounds(0, 0);
- content_bounds = content_layer_->layer()->bounds();
-
- gfx::Size actual_content_size(content_layer_->GetContentSize());
-
- bool view_and_content_have_same_orientation =
- (content_viewport_size.width() > content_viewport_size.height()) ==
- (actual_content_size.width() > actual_content_size.height()) &&
- actual_content_size.width() > 0 && actual_content_size.height() > 0 &&
- content_viewport_size.width() > 0 && content_viewport_size.height() > 0;
-
- // This may not be true for frames during rotation.
- bool content_has_consistent_width =
- actual_content_size.width() == content_bounds.width() &&
- actual_content_size.width() == content_viewport_size.width();
-
- if (view_and_content_have_same_orientation ||
- (content_has_consistent_width && content_layer_->ShowingLiveLayer())) {
- y += content_offset_y;
- } else {
- // If our orientations are off and we have a static texture, or if we have
- // a live layer of an unexpected width, move the texture in by the
- // appropriate amount.
- x += content_viewport_offset.x();
- y += content_viewport_offset.y();
- }
+ false, gfx::Rect());
content_layer_->layer()->SetPosition(gfx::PointF(x, y));
content_layer_->layer()->SetIsDrawable(true);
« no previous file with comments | « chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698