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

Unified Diff: ui/ozone/platform/dri/native_window_delegate_impl.cc

Issue 479713002: [Ozone-GBM] Adding NativeWindowDelegate to IPC window changes to the GPU (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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: ui/ozone/platform/dri/native_window_delegate_impl.cc
diff --git a/ui/ozone/platform/dri/native_window_delegate_impl.cc b/ui/ozone/platform/dri/native_window_delegate_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..74b452891178cf4765e961d7f94ee0402c690125
--- /dev/null
+++ b/ui/ozone/platform/dri/native_window_delegate_impl.cc
@@ -0,0 +1,38 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/dri/native_window_delegate_impl.h"
+
+#include "ui/ozone/platform/dri/native_window_manager.h"
+#include "ui/ozone/platform/dri/screen_manager.h"
+
+namespace ui {
+
+NativeWindowDelegateImpl::NativeWindowDelegateImpl(
+ gfx::AcceleratedWidget widget,
+ NativeWindowManager* window_manager,
+ ScreenManager* screen_manager)
+ : widget_(widget),
+ window_manager_(window_manager),
+ screen_manager_(screen_manager) {
+ window_manager_->AddNativeWindowDelegate(widget_, this);
+}
+
+NativeWindowDelegateImpl::~NativeWindowDelegateImpl() {
+ window_manager_->RemoveNativeWindowDelegate(widget_);
+}
+
+gfx::AcceleratedWidget NativeWindowDelegateImpl::GetWidget() {
+ return widget_;
+}
+
+HardwareDisplayController* NativeWindowDelegateImpl::GetController() {
+ return controller_.get();
+}
+
+void NativeWindowDelegateImpl::OnBoundsChanged(const gfx::Rect& bounds) {
+ controller_ = screen_manager_->GetDisplayController(bounds);
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698