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

Side by Side Diff: ui/ozone/demo/surfaceless_gl_renderer.cc

Issue 1417753007: ui: Revert gfx::BufferUsage::SCANOUT to gfx::BufferUsage::GPU_READ_WRITE change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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/gl/gl_surface_ozone.cc ('k') | ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/demo/surfaceless_gl_renderer.h" 5 #include "ui/ozone/demo/surfaceless_gl_renderer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "ui/gl/gl_bindings.h" 9 #include "ui/gl/gl_bindings.h"
10 #include "ui/gl/gl_context.h" 10 #include "ui/gl/gl_context.h"
(...skipping 22 matching lines...) Expand all
33 bool SurfacelessGlRenderer::BufferWrapper::Initialize( 33 bool SurfacelessGlRenderer::BufferWrapper::Initialize(
34 gfx::AcceleratedWidget widget, 34 gfx::AcceleratedWidget widget,
35 const gfx::Size& size) { 35 const gfx::Size& size) {
36 glGenFramebuffersEXT(1, &gl_fb_); 36 glGenFramebuffersEXT(1, &gl_fb_);
37 glGenTextures(1, &gl_tex_); 37 glGenTextures(1, &gl_tex_);
38 38
39 scoped_refptr<NativePixmap> pixmap = 39 scoped_refptr<NativePixmap> pixmap =
40 OzonePlatform::GetInstance() 40 OzonePlatform::GetInstance()
41 ->GetSurfaceFactoryOzone() 41 ->GetSurfaceFactoryOzone()
42 ->CreateNativePixmap(widget, size, gfx::BufferFormat::BGRX_8888, 42 ->CreateNativePixmap(widget, size, gfx::BufferFormat::BGRX_8888,
43 gfx::BufferUsage::GPU_READ_WRITE); 43 gfx::BufferUsage::SCANOUT);
44 scoped_refptr<gfx::GLImageOzoneNativePixmap> image( 44 scoped_refptr<gfx::GLImageOzoneNativePixmap> image(
45 new gfx::GLImageOzoneNativePixmap(size, GL_RGB)); 45 new gfx::GLImageOzoneNativePixmap(size, GL_RGB));
46 if (!image->Initialize(pixmap.get(), gfx::BufferFormat::BGRX_8888)) { 46 if (!image->Initialize(pixmap.get(), gfx::BufferFormat::BGRX_8888)) {
47 LOG(ERROR) << "Failed to create GLImage"; 47 LOG(ERROR) << "Failed to create GLImage";
48 return false; 48 return false;
49 } 49 }
50 image_ = image; 50 image_ = image;
51 51
52 glBindFramebufferEXT(GL_FRAMEBUFFER, gl_fb_); 52 glBindFramebufferEXT(GL_FRAMEBUFFER, gl_fb_);
53 glBindTexture(GL_TEXTURE_2D, gl_tex_); 53 glBindTexture(GL_TEXTURE_2D, gl_tex_);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 case gfx::SwapResult::SWAP_ACK: 131 case gfx::SwapResult::SWAP_ACK:
132 GlRenderer::PostRenderFrameTask(result); 132 GlRenderer::PostRenderFrameTask(result);
133 break; 133 break;
134 case gfx::SwapResult::SWAP_FAILED: 134 case gfx::SwapResult::SWAP_FAILED:
135 LOG(FATAL) << "Failed to swap buffers"; 135 LOG(FATAL) << "Failed to swap buffers";
136 break; 136 break;
137 } 137 }
138 } 138 }
139 139
140 } // namespace ui 140 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_ozone.cc ('k') | ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698