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

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

Issue 348923002: ozone: Build fixes for gbm & component build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: everything is sideways Created 6 years, 6 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 scoped_ptr<ui::SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget( 146 scoped_ptr<ui::SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget(
147 gfx::AcceleratedWidget w) { 147 gfx::AcceleratedWidget w) {
148 CHECK(state_ == INITIALIZED); 148 CHECK(state_ == INITIALIZED);
149 ResetCursor(w); 149 ResetCursor(w);
150 150
151 return scoped_ptr<ui::SurfaceOzoneEGL>( 151 return scoped_ptr<ui::SurfaceOzoneEGL>(
152 new GbmSurfaceAdapter(screen_manager_->GetDisplayController(w))); 152 new GbmSurfaceAdapter(screen_manager_->GetDisplayController(w)));
153 } 153 }
154 154
155 gfx::NativeBufferOzone GbmSurfaceFactory::CreateNativeBuffer( 155 ui::NativeBufferOzone GbmSurfaceFactory::CreateNativeBuffer(
156 gfx::Size size, 156 gfx::Size size,
157 BufferFormat format) { 157 BufferFormat format) {
158 uint32_t gbm_format = 0; 158 uint32_t gbm_format = 0;
159 switch (format) { 159 switch (format) {
160 case SurfaceFactoryOzone::UNKNOWN: 160 case SurfaceFactoryOzone::UNKNOWN:
161 return 0; 161 return 0;
162 // TODO(alexst): Setting this to XRGB for now to allow presentation 162 // TODO(alexst): Setting this to XRGB for now to allow presentation
163 // as a primary plane but disallowing overlay transparency. Address this 163 // as a primary plane but disallowing overlay transparency. Address this
164 // to allow both use cases. 164 // to allow both use cases.
165 case SurfaceFactoryOzone::RGBA_8888: 165 case SurfaceFactoryOzone::RGBA_8888:
166 gbm_format = GBM_FORMAT_XRGB8888; 166 gbm_format = GBM_FORMAT_XRGB8888;
167 break; 167 break;
168 case SurfaceFactoryOzone::RGB_888: 168 case SurfaceFactoryOzone::RGB_888:
169 gbm_format = GBM_FORMAT_RGB888; 169 gbm_format = GBM_FORMAT_RGB888;
170 break; 170 break;
171 } 171 }
172 gbm_bo* buffer_object = 172 gbm_bo* buffer_object =
173 gbm_bo_create(device_, 173 gbm_bo_create(device_,
174 size.width(), 174 size.width(),
175 size.height(), 175 size.height(),
176 gbm_format, 176 gbm_format,
177 GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); 177 GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
178 if (!buffer_object) 178 if (!buffer_object)
179 return 0; 179 return 0;
180 180
181 BufferData* data = BufferData::CreateData(drm_, buffer_object); 181 BufferData* data = BufferData::CreateData(drm_, buffer_object);
182 DCHECK(data) << "Failed to associate the buffer with the controller"; 182 DCHECK(data) << "Failed to associate the buffer with the controller";
183 183
184 return reinterpret_cast<gfx::NativeBufferOzone>(buffer_object); 184 return reinterpret_cast<ui::NativeBufferOzone>(buffer_object);
185 } 185 }
186 186
187 } // namespace ui 187 } // 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