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

Unified Diff: chrome/browser/android/vr_shell/vr_compositor.cc

Issue 2843993002: VR: Remove unnecessary transparency support from VR compositor. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_compositor.h ('k') | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_compositor.cc
diff --git a/chrome/browser/android/vr_shell/vr_compositor.cc b/chrome/browser/android/vr_shell/vr_compositor.cc
index 9ea4284054a6098552536c3d97f9ecde07293a93..673efc02757b840aad6c6a4176b1052346997c1f 100644
--- a/chrome/browser/android/vr_shell/vr_compositor.cc
+++ b/chrome/browser/android/vr_shell/vr_compositor.cc
@@ -15,10 +15,8 @@
namespace vr_shell {
-VrCompositor::VrCompositor(ui::WindowAndroid* window, bool transparent)
- : background_color_(SK_ColorWHITE), transparent_(transparent) {
+VrCompositor::VrCompositor(ui::WindowAndroid* window) {
compositor_.reset(content::Compositor::Create(this, window));
- compositor_->SetHasTransparentBackground(transparent);
}
VrCompositor::~VrCompositor() {
@@ -39,24 +37,15 @@ void VrCompositor::SetLayer(content::WebContents* web_contents) {
// removing it from its previous parent, so we remember that and restore it to
// its previous parent on teardown.
layer_ = view_android->GetLayer();
-
- // Remember the old background color to be restored later.
- background_color_ = layer_->background_color();
- if (transparent_) {
- layer_->SetBackgroundColor(SK_ColorTRANSPARENT);
- }
layer_parent_ = layer_->parent();
compositor_->SetRootLayer(layer_);
}
void VrCompositor::RestoreLayer() {
- if (!layer_)
- return;
- layer_->SetBackgroundColor(background_color_);
- if (layer_parent_) {
+ if (layer_ && layer_parent_)
layer_parent_->AddChild(layer_);
- }
layer_ = nullptr;
+ layer_parent_ = nullptr;
}
void VrCompositor::SurfaceDestroyed() {
« no previous file with comments | « chrome/browser/android/vr_shell/vr_compositor.h ('k') | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698