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

Side by Side Diff: chrome/browser/android/compositor/compositor_view.cc

Issue 2810813004: Hide fullscreen rotation jank (Closed)
Patch Set: Clear thumbnail cache instead of hiding static layer. Break out results of changing fullscreen stat… 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/compositor_view.h" 5 #include "chrome/browser/android/compositor/compositor_view.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 gfx::Size size(width, height); 178 gfx::Size size(width, height);
179 web_contents->GetNativeView()->OnPhysicalBackingSizeChanged(size); 179 web_contents->GetNativeView()->OnPhysicalBackingSizeChanged(size);
180 } 180 }
181 181
182 void CompositorView::SetLayoutBounds(JNIEnv* env, 182 void CompositorView::SetLayoutBounds(JNIEnv* env,
183 const JavaParamRef<jobject>& object) { 183 const JavaParamRef<jobject>& object) {
184 root_layer_->SetBounds(gfx::Size(content_width_, content_height_)); 184 root_layer_->SetBounds(gfx::Size(content_width_, content_height_));
185 } 185 }
186 186
187 void CompositorView::SetBackground(bool visible, SkColor color) { 187 void CompositorView::SetBackground(bool visible, SkColor color) {
188 if (overlay_video_mode_)
189 visible = false;
190 root_layer_->SetBackgroundColor(color); 188 root_layer_->SetBackgroundColor(color);
Khushal 2017/06/23 03:09:51 Another thing, this root_layer_ doesn't need to be
191 root_layer_->SetIsDrawable(visible); 189 root_layer_->SetIsDrawable(visible);
190 compositor_->SetBackgroundColor(color);
191 compositor_->SetHasTransparentBackground(SkColorGetA(color) ==
192 SK_AlphaTRANSPARENT);
192 } 193 }
193 194
194 void CompositorView::SetOverlayVideoMode(JNIEnv* env, 195 void CompositorView::SetOverlayVideoMode(JNIEnv* env,
195 const JavaParamRef<jobject>& object, 196 const JavaParamRef<jobject>& object,
196 bool enabled) { 197 bool enabled) {
197 if (overlay_video_mode_ == enabled) 198 if (overlay_video_mode_ == enabled)
198 return; 199 return;
199 overlay_video_mode_ = enabled; 200 overlay_video_mode_ = enabled;
200 compositor_->SetHasTransparentBackground(enabled);
201 SetNeedsComposite(env, object); 201 SetNeedsComposite(env, object);
202 } 202 }
203 203
204 void CompositorView::SetSceneLayer(JNIEnv* env, 204 void CompositorView::SetSceneLayer(JNIEnv* env,
205 const JavaParamRef<jobject>& object, 205 const JavaParamRef<jobject>& object,
206 const JavaParamRef<jobject>& jscene_layer) { 206 const JavaParamRef<jobject>& jscene_layer) {
207 SceneLayer* scene_layer = SceneLayer::FromJavaObject(env, jscene_layer); 207 SceneLayer* scene_layer = SceneLayer::FromJavaObject(env, jscene_layer);
208 208
209 if (scene_layer_ != scene_layer) { 209 if (scene_layer_ != scene_layer) {
210 // The old tree should be detached only if it is not the cached layer or 210 // The old tree should be detached only if it is not the cached layer or
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // The Android TERMINATION_STATUS_OOM_PROTECTED hack causes us to never go 270 // The Android TERMINATION_STATUS_OOM_PROTECTED hack causes us to never go
271 // through here but through BrowserChildProcessHostDisconnected() instead. 271 // through here but through BrowserChildProcessHostDisconnected() instead.
272 } 272 }
273 273
274 // Register native methods 274 // Register native methods
275 bool RegisterCompositorView(JNIEnv* env) { 275 bool RegisterCompositorView(JNIEnv* env) {
276 return RegisterNativesImpl(env); 276 return RegisterNativesImpl(env);
277 } 277 }
278 278
279 } // namespace android 279 } // namespace android
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698