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

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

Issue 2768343002: Change namespace from ui to gfx for NativePixmap related code (Closed)
Patch Set: Addressed sadrul's remark Created 3 years, 9 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/demo/surfaceless_gl_renderer.h" 5 #include "ui/ozone/demo/surfaceless_gl_renderer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 } 35 }
36 36
37 bool SurfacelessGlRenderer::BufferWrapper::Initialize( 37 bool SurfacelessGlRenderer::BufferWrapper::Initialize(
38 gfx::AcceleratedWidget widget, 38 gfx::AcceleratedWidget widget,
39 const gfx::Size& size) { 39 const gfx::Size& size) {
40 glGenFramebuffersEXT(1, &gl_fb_); 40 glGenFramebuffersEXT(1, &gl_fb_);
41 glGenTextures(1, &gl_tex_); 41 glGenTextures(1, &gl_tex_);
42 42
43 gfx::BufferFormat format = display::DisplaySnapshot::PrimaryFormat(); 43 gfx::BufferFormat format = display::DisplaySnapshot::PrimaryFormat();
44 scoped_refptr<NativePixmap> pixmap = 44 scoped_refptr<gfx::NativePixmap> pixmap =
45 OzonePlatform::GetInstance() 45 OzonePlatform::GetInstance()
46 ->GetSurfaceFactoryOzone() 46 ->GetSurfaceFactoryOzone()
47 ->CreateNativePixmap(widget, size, format, gfx::BufferUsage::SCANOUT); 47 ->CreateNativePixmap(widget, size, format, gfx::BufferUsage::SCANOUT);
48 scoped_refptr<ui::GLImageNativePixmap> image( 48 scoped_refptr<gl::GLImageNativePixmap> image(
49 new ui::GLImageNativePixmap(size, GL_RGB)); 49 new gl::GLImageNativePixmap(size, GL_RGB));
50 if (!image->Initialize(pixmap.get(), format)) { 50 if (!image->Initialize(pixmap.get(), format)) {
51 LOG(ERROR) << "Failed to create GLImage"; 51 LOG(ERROR) << "Failed to create GLImage";
52 return false; 52 return false;
53 } 53 }
54 image_ = image; 54 image_ = image;
55 55
56 glBindFramebufferEXT(GL_FRAMEBUFFER, gl_fb_); 56 glBindFramebufferEXT(GL_FRAMEBUFFER, gl_fb_);
57 glBindTexture(GL_TEXTURE_2D, gl_tex_); 57 glBindTexture(GL_TEXTURE_2D, gl_tex_);
58 image_->BindTexImage(GL_TEXTURE_2D); 58 image_->BindTexImage(GL_TEXTURE_2D);
59 59
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 case gfx::SwapResult::SWAP_ACK: 156 case gfx::SwapResult::SWAP_ACK:
157 GlRenderer::PostRenderFrameTask(result); 157 GlRenderer::PostRenderFrameTask(result);
158 break; 158 break;
159 case gfx::SwapResult::SWAP_FAILED: 159 case gfx::SwapResult::SWAP_FAILED:
160 LOG(FATAL) << "Failed to swap buffers"; 160 LOG(FATAL) << "Failed to swap buffers";
161 break; 161 break;
162 } 162 }
163 } 163 }
164 164
165 } // namespace ui 165 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/common/stub_client_native_pixmap_factory.cc ('k') | ui/ozone/generate_constructor_list.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698