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

Side by Side Diff: ui/ozone/platform/dri/gbm_surface_factory.cc

Issue 356083002: [Ozone] Add Ozone EGL demo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "ui/ozone/platform/dri/gbm_surface_factory.h" 5 #include "ui/ozone/platform/dri/gbm_surface_factory.h"
6 6
7 #include <EGL/egl.h> 7 #include <EGL/egl.h>
8 #include <gbm.h> 8 #include <gbm.h>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 return false; 69 return false;
70 } 70 }
71 71
72 scoped_ptr<gfx::VSyncProvider> GbmSurfaceAdapter::CreateVSyncProvider() { 72 scoped_ptr<gfx::VSyncProvider> GbmSurfaceAdapter::CreateVSyncProvider() {
73 return scoped_ptr<gfx::VSyncProvider>(new DriVSyncProvider(controller_)); 73 return scoped_ptr<gfx::VSyncProvider>(new DriVSyncProvider(controller_));
74 } 74 }
75 75
76 } // namespace 76 } // namespace
77 77
78 GbmSurfaceFactory::GbmSurfaceFactory(DriWrapper* dri, 78 GbmSurfaceFactory::GbmSurfaceFactory()
79 gbm_device* device, 79 : DriSurfaceFactory(NULL, NULL),
80 ScreenManager* screen_manager) 80 device_(NULL) {}
81 : DriSurfaceFactory(dri, screen_manager),
82 device_(device) {}
83 81
84 GbmSurfaceFactory::~GbmSurfaceFactory() {} 82 GbmSurfaceFactory::~GbmSurfaceFactory() {}
85 83
84 void GbmSurfaceFactory::InitializeGpu(
85 DriWrapper* dri, gbm_device* device, ScreenManager* screen_manager) {
86 drm_ = dri;
87 device_ = device;
88 screen_manager_ = screen_manager;
89 }
90
86 intptr_t GbmSurfaceFactory::GetNativeDisplay() { 91 intptr_t GbmSurfaceFactory::GetNativeDisplay() {
87 CHECK(state_ == INITIALIZED); 92 CHECK(state_ == INITIALIZED);
88 return reinterpret_cast<intptr_t>(device_); 93 return reinterpret_cast<intptr_t>(device_);
89 } 94 }
90 95
91 const int32* GbmSurfaceFactory::GetEGLSurfaceProperties( 96 const int32* GbmSurfaceFactory::GetEGLSurfaceProperties(
92 const int32* desired_list) { 97 const int32* desired_list) {
93 static const int32 kConfigAttribs[] = { 98 static const int32 kConfigAttribs[] = {
94 EGL_BUFFER_SIZE, 32, 99 EGL_BUFFER_SIZE, 32,
95 EGL_ALPHA_SIZE, 8, 100 EGL_ALPHA_SIZE, 8,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 if (!buffer_object) 183 if (!buffer_object)
179 return 0; 184 return 0;
180 185
181 BufferData* data = BufferData::CreateData(drm_, buffer_object); 186 BufferData* data = BufferData::CreateData(drm_, buffer_object);
182 DCHECK(data) << "Failed to associate the buffer with the controller"; 187 DCHECK(data) << "Failed to associate the buffer with the controller";
183 188
184 return reinterpret_cast<ui::NativeBufferOzone>(buffer_object); 189 return reinterpret_cast<ui::NativeBufferOzone>(buffer_object);
185 } 190 }
186 191
187 } // namespace ui 192 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/gbm_surface_factory.h ('k') | ui/ozone/platform/dri/ozone_platform_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698