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

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

Issue 2268993003: [Command Buffer] Coding style: FrameBuffer -> Framebuffer to be comformant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code rebase Created 4 years, 3 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
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surface.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.h" 5 #include "ui/ozone/platform/drm/gpu/gbm_surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/gl/gl_surface_egl.h" 10 #include "ui/gl/gl_surface_egl.h"
11 #include "ui/ozone/gl/gl_image_ozone_native_pixmap.h" 11 #include "ui/ozone/gl/gl_image_ozone_native_pixmap.h"
12 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" 12 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
13 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" 13 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h"
14 #include "ui/ozone/public/native_pixmap.h" 14 #include "ui/ozone/public/native_pixmap.h"
15 15
16 namespace ui { 16 namespace ui {
17 17
18 GbmSurface::GbmSurface(GbmSurfaceFactory* surface_factory, 18 GbmSurface::GbmSurface(GbmSurfaceFactory* surface_factory,
19 std::unique_ptr<DrmWindowProxy> window, 19 std::unique_ptr<DrmWindowProxy> window,
20 gfx::AcceleratedWidget widget) 20 gfx::AcceleratedWidget widget)
21 : GbmSurfaceless(surface_factory, std::move(window), widget) { 21 : GbmSurfaceless(surface_factory, std::move(window), widget) {
22 for (auto& texture : textures_) 22 for (auto& texture : textures_)
23 texture = 0; 23 texture = 0;
24 } 24 }
25 25
26 unsigned int GbmSurface::GetBackingFrameBufferObject() { 26 unsigned int GbmSurface::GetBackingFramebufferObject() {
27 return fbo_; 27 return fbo_;
28 } 28 }
29 29
30 bool GbmSurface::OnMakeCurrent(gl::GLContext* context) { 30 bool GbmSurface::OnMakeCurrent(gl::GLContext* context) {
31 DCHECK(!context_ || context == context_); 31 DCHECK(!context_ || context == context_);
32 context_ = context; 32 context_ = context;
33 if (!fbo_) { 33 if (!fbo_) {
34 glGenFramebuffersEXT(1, &fbo_); 34 glGenFramebuffersEXT(1, &fbo_);
35 if (!fbo_) 35 if (!fbo_)
36 return false; 36 return false;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 bool GbmSurface::IsSurfaceless() const { 109 bool GbmSurface::IsSurfaceless() const {
110 return false; 110 return false;
111 } 111 }
112 112
113 GbmSurface::~GbmSurface() { 113 GbmSurface::~GbmSurface() {
114 Destroy(); 114 Destroy();
115 } 115 }
116 116
117 void GbmSurface::BindFramebuffer() { 117 void GbmSurface::BindFramebuffer() {
118 gl::ScopedFrameBufferBinder fb(fbo_); 118 gl::ScopedFramebufferBinder fb(fbo_);
119 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 119 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
120 textures_[current_surface_], 0); 120 textures_[current_surface_], 0);
121 } 121 }
122 122
123 bool GbmSurface::CreatePixmaps() { 123 bool GbmSurface::CreatePixmaps() {
124 if (!fbo_) 124 if (!fbo_)
125 return true; 125 return true;
126 for (size_t i = 0; i < arraysize(textures_); i++) { 126 for (size_t i = 0; i < arraysize(textures_); i++) {
127 scoped_refptr<NativePixmap> pixmap = surface_factory()->CreateNativePixmap( 127 scoped_refptr<NativePixmap> pixmap = surface_factory()->CreateNativePixmap(
128 widget(), GetSize(), gfx::BufferFormat::BGRA_8888, 128 widget(), GetSize(), gfx::BufferFormat::BGRA_8888,
(...skipping 10 matching lines...) Expand all
139 images_[i] = image; 139 images_[i] = image;
140 // Bind image to texture. 140 // Bind image to texture.
141 gl::ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]); 141 gl::ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]);
142 if (!images_[i]->BindTexImage(GL_TEXTURE_2D)) 142 if (!images_[i]->BindTexImage(GL_TEXTURE_2D))
143 return false; 143 return false;
144 } 144 }
145 return true; 145 return true;
146 } 146 }
147 147
148 } // namespace ui 148 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698