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

Side by Side Diff: ui/ozone/platform/drm/gpu/gbm_surface_factory.cc

Issue 2190353003: Delete old Ozone surface creation API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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
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/drm/gpu/gbm_surface_factory.h" 5 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h"
6 6
7 #include <gbm.h> 7 #include <gbm.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 GbmSurfaceless* GbmSurfaceFactory::GetSurface( 49 GbmSurfaceless* GbmSurfaceFactory::GetSurface(
50 gfx::AcceleratedWidget widget) const { 50 gfx::AcceleratedWidget widget) const {
51 DCHECK(thread_checker_.CalledOnValidThread()); 51 DCHECK(thread_checker_.CalledOnValidThread());
52 auto it = widget_to_surface_map_.find(widget); 52 auto it = widget_to_surface_map_.find(widget);
53 DCHECK(it != widget_to_surface_map_.end()); 53 DCHECK(it != widget_to_surface_map_.end());
54 return it->second; 54 return it->second;
55 } 55 }
56 56
57 bool GbmSurfaceFactory::UseNewSurfaceAPI() {
58 return true;
59 }
60
61 scoped_refptr<gl::GLSurface> GbmSurfaceFactory::CreateViewGLSurface( 57 scoped_refptr<gl::GLSurface> GbmSurfaceFactory::CreateViewGLSurface(
62 gl::GLImplementation implementation, 58 gl::GLImplementation implementation,
63 gfx::AcceleratedWidget widget) { 59 gfx::AcceleratedWidget widget) {
64 DCHECK(thread_checker_.CalledOnValidThread()); 60 DCHECK(thread_checker_.CalledOnValidThread());
65 61
66 if (implementation != gl::kGLImplementationEGLGLES2) { 62 if (implementation != gl::kGLImplementationEGLGLES2) {
67 NOTREACHED(); 63 NOTREACHED();
68 return nullptr; 64 return nullptr;
69 } 65 }
70 66
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 165 }
170 166
171 scoped_refptr<GbmBuffer> buffer = drm_thread_->CreateBufferFromFds( 167 scoped_refptr<GbmBuffer> buffer = drm_thread_->CreateBufferFromFds(
172 widget, size, format, std::move(scoped_fds), planes); 168 widget, size, format, std::move(scoped_fds), planes);
173 if (!buffer) 169 if (!buffer)
174 return nullptr; 170 return nullptr;
175 return make_scoped_refptr(new GbmPixmap(this, buffer)); 171 return make_scoped_refptr(new GbmPixmap(this, buffer));
176 } 172 }
177 173
178 } // namespace ui 174 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surface_factory.h ('k') | ui/ozone/platform/drm/gpu/page_flip_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698