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

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

Issue 2428383006: Decouple VR Shell DPR and CSS size from Physical Displays. (Closed)
Patch Set: Address bshe comments + minor fix 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/vr_shell/vr_compositor.h ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('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 ad52fd233a44e5e1bb677cfdc420060b95378bcd..6681e8d340d0ec573e1fd6d55f210358e5bffabd 100644
--- a/chrome/browser/android/vr_shell/vr_compositor.cc
+++ b/chrome/browser/android/vr_shell/vr_compositor.cc
@@ -10,6 +10,8 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/android/window_android.h"
+using base::android::JavaParamRef;
+
namespace vr_shell {
VrCompositor::VrCompositor(ui::WindowAndroid* window, bool transparent)
@@ -35,6 +37,7 @@ void VrCompositor::OnSwapBuffersCompleted(int pending_swap_buffers) {}
void VrCompositor::SetLayer(content::WebContents* web_contents) {
assert(layer_ == nullptr);
ui::ViewAndroid* view_android = web_contents->GetNativeView();
+
// When we pass the layer for the ContentViewCore to the compositor it may be
// removing it from its previous parent, so we remember that and restore it to
// its previous parent on teardown.
@@ -53,13 +56,13 @@ void VrCompositor::SurfaceDestroyed() {
compositor_->SetSurface(nullptr);
}
-void VrCompositor::SurfaceChanged(
- int width,
- int height,
- const base::android::JavaParamRef<jobject>& surface) {
+void VrCompositor::SetWindowBounds(int width, int height) {
+ compositor_->SetWindowBounds(gfx::Size(width, height));
+}
+
+void VrCompositor::SurfaceChanged(const JavaParamRef<jobject>& surface) {
DCHECK(surface);
compositor_->SetSurface(surface);
- compositor_->SetWindowBounds(gfx::Size(width, height));
}
} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/vr_compositor.h ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698