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

Side by Side Diff: ui/ozone/platform/dri/native_window_delegate_proxy.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/ozone/platform/dri/native_window_delegate_proxy.h"
6
7 #include "ui/ozone/common/gpu/ozone_gpu_messages.h"
8 #include "ui/ozone/platform/dri/gpu_platform_support_host_gbm.h"
9 #include "ui/ozone/platform/dri/native_window_manager.h"
10
11 namespace ui {
12
13 NativeWindowDelegateProxy::NativeWindowDelegateProxy(
14 NativeWindowManager* window_manager,
15 GpuPlatformSupportHostGbm* sender)
16 : widget_(window_manager->AllocateAcceleratedWidget()),
17 window_manager_(window_manager),
18 sender_(sender) {
19 window_manager_->AddNativeWindowDelegate(widget_, this);
20 bool status =
21 sender_->Send(new OzoneGpuMsg_CreateNativeWindowDelegate(widget_));
22 DCHECK(status);
23 }
24
25 NativeWindowDelegateProxy::~NativeWindowDelegateProxy() {
26 window_manager_->RemoveNativeWindowDelegate(widget_);
27 bool status =
28 sender_->Send(new OzoneGpuMsg_DestoryNativeWindowDelegate(widget_));
29 DCHECK(status);
30 }
31
32 gfx::AcceleratedWidget NativeWindowDelegateProxy::GetWidget() {
33 return widget_;
34 }
35
36 HardwareDisplayController* NativeWindowDelegateProxy::GetController() {
37 NOTREACHED();
38 return NULL;
39 }
40
41 void NativeWindowDelegateProxy::OnBoundsChanged(const gfx::Rect& bounds) {
42 bool status = sender_->Send(
43 new OzoneGpuMsg_NativeWindowBoundsChanged(widget_, bounds));
44 DCHECK(status);
45 }
46
47 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698