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

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: Created 4 years, 2 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
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 2c69483e9a6c7d6f06b068d49ec40f614f4d094f..a300f643614c3f3277113491b2da4b8a1df36d66 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

Powered by Google App Engine
This is Rietveld 408576698