Index: chrome/browser/android/compositor/compositor_view.cc |
diff --git a/chrome/browser/android/compositor/compositor_view.cc b/chrome/browser/android/compositor/compositor_view.cc |
index 4b525711cbc5f59c6f6a1e0f101bafb52872234a..a2faa8e4c3ca4f17f51cb3662847be4bdd674d62 100644 |
--- a/chrome/browser/android/compositor/compositor_view.cc |
+++ b/chrome/browser/android/compositor/compositor_view.cc |
@@ -29,6 +29,7 @@ |
#include "content/public/browser/android/content_view_core.h" |
#include "content/public/browser/child_process_data.h" |
#include "content/public/browser/web_contents.h" |
+#include "content/public/common/content_features.h" |
#include "content/public/common/process_type.h" |
#include "jni/CompositorView_jni.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
@@ -185,10 +186,22 @@ void CompositorView::SetLayoutBounds(JNIEnv* env, |
} |
void CompositorView::SetBackground(bool visible, SkColor color) { |
- if (overlay_video_mode_) |
+ // TODO(steimel): Remove this feature flag and the hack inside this if block |
+ // once we're confident that the fullscreen transition hiding is working |
+ // properly. |
+ if (!base::FeatureList::IsEnabled(features::kHideFullscreenTransitionJank) && |
+ overlay_video_mode_) { |
visible = false; |
+ } |
root_layer_->SetBackgroundColor(color); |
root_layer_->SetIsDrawable(visible); |
+ // TODO(steimel): Remove this feature flag check once we're confident that the |
+ // fullscreen transition hiding is working properly. |
+ if (base::FeatureList::IsEnabled(features::kHideFullscreenTransitionJank)) { |
+ compositor_->SetBackgroundColor(color); |
+ compositor_->SetHasTransparentBackground(SkColorGetA(color) == |
+ SK_AlphaTRANSPARENT); |
+ } |
} |
void CompositorView::SetOverlayVideoMode(JNIEnv* env, |
@@ -197,7 +210,12 @@ void CompositorView::SetOverlayVideoMode(JNIEnv* env, |
if (overlay_video_mode_ == enabled) |
return; |
overlay_video_mode_ = enabled; |
- compositor_->SetHasTransparentBackground(enabled); |
+ // TODO(steimel): Remove this feature flag and the hack inside this if block |
+ // once we're confident that the fullscreen transition hiding is working |
+ // properly. |
+ if (!base::FeatureList::IsEnabled(features::kHideFullscreenTransitionJank)) { |
+ compositor_->SetHasTransparentBackground(enabled); |
+ } |
SetNeedsComposite(env, object); |
} |