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

Side by Side Diff: chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc

Issue 2810813004: Hide fullscreen rotation jank (Closed)
Patch Set: Refactor jank logic. Make RWHVA a WebContentsObserver to observe fullscreen state Created 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.h" 5 #include "chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "chrome/browser/android/compositor/layer/content_layer.h" 8 #include "chrome/browser/android/compositor/layer/content_layer.h"
9 #include "chrome/browser/android/compositor/layer/tab_layer.h" 9 #include "chrome/browser/android/compositor/layer/tab_layer.h"
10 #include "chrome/browser/android/compositor/layer_title_cache.h" 10 #include "chrome/browser/android/compositor/layer_title_cache.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (!tab_content_manager_) { 79 if (!tab_content_manager_) {
80 tab_content_manager_ = 80 tab_content_manager_ =
81 TabContentManager::FromJavaObject(jtab_content_manager); 81 TabContentManager::FromJavaObject(jtab_content_manager);
82 } 82 }
83 83
84 background_color_ = background_color; 84 background_color_ = background_color;
85 own_tree_->SetPosition(gfx::PointF(viewport_x, viewport_y)); 85 own_tree_->SetPosition(gfx::PointF(viewport_x, viewport_y));
86 own_tree_->SetBounds(gfx::Size(viewport_width, viewport_height)); 86 own_tree_->SetBounds(gfx::Size(viewport_width, viewport_height));
87 } 87 }
88 88
89 void TabListSceneLayer::PutTabLayer( 89 void TabListSceneLayer::PutTabLayer(JNIEnv* env,
90 JNIEnv* env, 90 const JavaParamRef<jobject>& jobj,
91 const JavaParamRef<jobject>& jobj, 91 jint id,
92 jint id, 92 jint toolbar_resource_id,
93 jint toolbar_resource_id, 93 jint close_button_resource_id,
94 jint close_button_resource_id, 94 jint shadow_resource_id,
95 jint shadow_resource_id, 95 jint contour_resource_id,
96 jint contour_resource_id, 96 jint back_logo_resource_id,
97 jint back_logo_resource_id, 97 jint border_resource_id,
98 jint border_resource_id, 98 jint border_inner_shadow_resource_id,
99 jint border_inner_shadow_resource_id, 99 jboolean can_use_live_layer,
100 jboolean can_use_live_layer, 100 jboolean can_use_static_layer,
101 jboolean browser_controls_at_bottom, 101 jboolean browser_controls_at_bottom,
102 jint tab_background_color, 102 jint tab_background_color,
103 jint back_logo_color, 103 jint back_logo_color,
104 jboolean incognito, 104 jboolean incognito,
105 jboolean is_portrait, 105 jboolean is_portrait,
106 jfloat x, 106 jfloat x,
107 jfloat y, 107 jfloat y,
108 jfloat width, 108 jfloat width,
109 jfloat height, 109 jfloat height,
110 jfloat content_width, 110 jfloat content_width,
111 jfloat content_height, 111 jfloat content_height,
112 jfloat visible_content_height, 112 jfloat visible_content_height,
113 jfloat shadow_x, 113 jfloat shadow_x,
114 jfloat shadow_y, 114 jfloat shadow_y,
115 jfloat shadow_width, 115 jfloat shadow_width,
116 jfloat shadow_height, 116 jfloat shadow_height,
117 jfloat pivot_x, 117 jfloat pivot_x,
118 jfloat pivot_y, 118 jfloat pivot_y,
119 jfloat rotation_x, 119 jfloat rotation_x,
120 jfloat rotation_y, 120 jfloat rotation_y,
121 jfloat alpha, 121 jfloat alpha,
122 jfloat border_alpha, 122 jfloat border_alpha,
123 jfloat border_inner_shadow_alpha, 123 jfloat border_inner_shadow_alpha,
124 jfloat contour_alpha, 124 jfloat contour_alpha,
125 jfloat shadow_alpha, 125 jfloat shadow_alpha,
126 jfloat close_alpha, 126 jfloat close_alpha,
127 jfloat close_btn_width, 127 jfloat close_btn_width,
128 jfloat static_to_view_blend, 128 jfloat static_to_view_blend,
129 jfloat border_scale, 129 jfloat border_scale,
130 jfloat saturation, 130 jfloat saturation,
131 jfloat brightness, 131 jfloat brightness,
132 jboolean show_toolbar, 132 jboolean show_toolbar,
133 jint default_theme_color, 133 jint default_theme_color,
134 jint toolbar_background_color, 134 jint toolbar_background_color,
135 jint close_button_color, 135 jint close_button_color,
136 jboolean anonymize_toolbar, 136 jboolean anonymize_toolbar,
137 jboolean show_tab_title, 137 jboolean show_tab_title,
138 jint toolbar_textbox_resource_id, 138 jint toolbar_textbox_resource_id,
139 jint toolbar_textbox_background_color, 139 jint toolbar_textbox_background_color,
140 jfloat toolbar_textbox_alpha, 140 jfloat toolbar_textbox_alpha,
141 jfloat toolbar_alpha, 141 jfloat toolbar_alpha,
142 jfloat toolbar_y_offset, 142 jfloat toolbar_y_offset,
143 jfloat side_border_scale, 143 jfloat side_border_scale,
144 jboolean inset_border) { 144 jboolean inset_border) {
145 scoped_refptr<TabLayer> layer; 145 scoped_refptr<TabLayer> layer;
146 auto iter = tab_map_.find(id); 146 auto iter = tab_map_.find(id);
147 if (iter != tab_map_.end()) { 147 if (iter != tab_map_.end()) {
148 layer = iter->second; 148 layer = iter->second;
149 } else { 149 } else {
150 layer = TabLayer::Create(incognito, resource_manager_, layer_title_cache_, 150 layer = TabLayer::Create(incognito, resource_manager_, layer_title_cache_,
151 tab_content_manager_); 151 tab_content_manager_);
152 tab_map_.insert(TabMap::value_type(id, layer)); 152 tab_map_.insert(TabMap::value_type(id, layer));
153 } 153 }
154 own_tree_->AddChild(layer->layer()); 154 own_tree_->AddChild(layer->layer());
155 visible_tabs_this_frame_.insert(id); 155 visible_tabs_this_frame_.insert(id);
156 156
157 // Add the tints for the border asset and close icon to the list that was 157 // Add the tints for the border asset and close icon to the list that was
158 // used for this frame. 158 // used for this frame.
159 used_tints_.insert(toolbar_background_color); 159 used_tints_.insert(toolbar_background_color);
160 used_tints_.insert(close_button_color); 160 used_tints_.insert(close_button_color);
161 161
162 DCHECK(layer); 162 DCHECK(layer);
163 if (layer) { 163 if (layer) {
164 layer->SetProperties( 164 layer->SetProperties(
165 id, can_use_live_layer, browser_controls_at_bottom, 165 id, can_use_live_layer, can_use_static_layer,
166 toolbar_resource_id, close_button_resource_id, 166 browser_controls_at_bottom, toolbar_resource_id,
167 shadow_resource_id, contour_resource_id, back_logo_resource_id, 167 close_button_resource_id, shadow_resource_id, contour_resource_id,
168 border_resource_id, border_inner_shadow_resource_id, 168 back_logo_resource_id, border_resource_id,
169 tab_background_color, back_logo_color, is_portrait, x, y, width, height, 169 border_inner_shadow_resource_id, tab_background_color, back_logo_color,
170 shadow_x, shadow_y, shadow_width, shadow_height, pivot_x, pivot_y, 170 is_portrait, x, y, width, height, shadow_x, shadow_y, shadow_width,
171 rotation_x, rotation_y, alpha, border_alpha, border_inner_shadow_alpha, 171 shadow_height, pivot_x, pivot_y, rotation_x, rotation_y, alpha,
172 contour_alpha, shadow_alpha, close_alpha, border_scale, saturation, 172 border_alpha, border_inner_shadow_alpha, contour_alpha, shadow_alpha,
173 brightness, close_btn_width, static_to_view_blend, content_width, 173 close_alpha, border_scale, saturation, brightness, close_btn_width,
174 content_height, content_width, visible_content_height, show_toolbar, 174 static_to_view_blend, content_width, content_height, content_width,
175 default_theme_color, toolbar_background_color, 175 visible_content_height, show_toolbar, default_theme_color,
176 close_button_color, anonymize_toolbar, show_tab_title, 176 toolbar_background_color, close_button_color, anonymize_toolbar,
177 toolbar_textbox_resource_id, toolbar_textbox_background_color, 177 show_tab_title, toolbar_textbox_resource_id,
178 toolbar_textbox_alpha, toolbar_alpha, toolbar_y_offset, 178 toolbar_textbox_background_color, toolbar_textbox_alpha, toolbar_alpha,
179 side_border_scale, inset_border); 179 toolbar_y_offset, side_border_scale, inset_border);
180 } 180 }
181 181
182 gfx::RectF self(own_tree_->position(), gfx::SizeF(own_tree_->bounds())); 182 gfx::RectF self(own_tree_->position(), gfx::SizeF(own_tree_->bounds()));
183 gfx::RectF content(x, y, width, height); 183 gfx::RectF content(x, y, width, height);
184 184
185 content_obscures_self_ |= content.Contains(self); 185 content_obscures_self_ |= content.Contains(self);
186 } 186 }
187 187
188 base::android::ScopedJavaLocalRef<jobject> TabListSceneLayer::GetJavaObject( 188 base::android::ScopedJavaLocalRef<jobject> TabListSceneLayer::GetJavaObject(
189 JNIEnv* env) { 189 JNIEnv* env) {
(...skipping 19 matching lines...) Expand all
209 // This will automatically bind to the Java object and pass ownership there. 209 // This will automatically bind to the Java object and pass ownership there.
210 TabListSceneLayer* scene_layer = new TabListSceneLayer(env, jobj); 210 TabListSceneLayer* scene_layer = new TabListSceneLayer(env, jobj);
211 return reinterpret_cast<intptr_t>(scene_layer); 211 return reinterpret_cast<intptr_t>(scene_layer);
212 } 212 }
213 213
214 bool RegisterTabListSceneLayer(JNIEnv* env) { 214 bool RegisterTabListSceneLayer(JNIEnv* env) {
215 return RegisterNativesImpl(env); 215 return RegisterNativesImpl(env);
216 } 216 }
217 217
218 } // namespace android 218 } // namespace android
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698