| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/vr_shell/vr_compositor.h" | 5 #include "chrome/browser/android/vr_shell/vr_compositor.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
| 8 #include "content/public/browser/android/compositor.h" | 8 #include "content/public/browser/android/compositor.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 layer_->SetBackgroundColor(SK_ColorTRANSPARENT); | 47 layer_->SetBackgroundColor(SK_ColorTRANSPARENT); |
| 48 } | 48 } |
| 49 layer_parent_ = layer_->parent(); | 49 layer_parent_ = layer_->parent(); |
| 50 compositor_->SetRootLayer(layer_); | 50 compositor_->SetRootLayer(layer_); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void VrCompositor::SurfaceDestroyed() { | 53 void VrCompositor::SurfaceDestroyed() { |
| 54 compositor_->SetSurface(nullptr); | 54 compositor_->SetSurface(nullptr); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void VrCompositor::SetWindowBounds(int width, int height) { | 57 void VrCompositor::SetWindowBounds(gfx::Size size) { |
| 58 compositor_->SetWindowBounds(gfx::Size(width, height)); | 58 bounds_ = size; |
| 59 compositor_->SetWindowBounds(bounds_); |
| 59 } | 60 } |
| 60 | 61 |
| 61 void VrCompositor::SurfaceChanged(jobject surface) { | 62 void VrCompositor::SurfaceChanged(jobject surface) { |
| 62 DCHECK(surface); | 63 DCHECK(surface); |
| 63 compositor_->SetSurface(surface); | 64 compositor_->SetSurface(surface); |
| 64 } | 65 } |
| 65 | 66 |
| 66 } // namespace vr_shell | 67 } // namespace vr_shell |
| OLD | NEW |