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

Side by Side Diff: content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.cc

Issue 699643002: ui: Remove GLImageGLX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h ('k') | content/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h"
6
7 #include "ui/gl/gl_image_glx.h"
8
9 namespace content {
10
11 GpuMemoryBufferFactoryX11Pixmap::GpuMemoryBufferFactoryX11Pixmap() {
12 }
13
14 GpuMemoryBufferFactoryX11Pixmap::~GpuMemoryBufferFactoryX11Pixmap() {
15 }
16
17 void GpuMemoryBufferFactoryX11Pixmap::CreateGpuMemoryBuffer(
18 const gfx::GpuMemoryBufferId& id,
19 XID pixmap) {
20 X11PixmapMapKey key(id.primary_id, id.secondary_id);
21 DCHECK(pixmaps_.find(key) == pixmaps_.end());
22 pixmaps_[key] = pixmap;
23 }
24
25 void GpuMemoryBufferFactoryX11Pixmap::DestroyGpuMemoryBuffer(
26 const gfx::GpuMemoryBufferId& id) {
27 X11PixmapMapKey key(id.primary_id, id.secondary_id);
28 X11PixmapMap::iterator it = pixmaps_.find(key);
29 if (it != pixmaps_.end())
30 pixmaps_.erase(it);
31 }
32
33 scoped_refptr<gfx::GLImage>
34 GpuMemoryBufferFactoryX11Pixmap::CreateImageForGpuMemoryBuffer(
35 const gfx::GpuMemoryBufferId& id,
36 const gfx::Size& size,
37 unsigned internalformat) {
38 X11PixmapMapKey key(id.primary_id, id.secondary_id);
39 X11PixmapMap::iterator it = pixmaps_.find(key);
40 if (it == pixmaps_.end())
41 return scoped_refptr<gfx::GLImage>();
42
43 scoped_refptr<gfx::GLImageGLX> image(
44 new gfx::GLImageGLX(size, internalformat));
45 if (!image->Initialize(it->second))
46 return scoped_refptr<gfx::GLImage>();
47
48 return image;
49 }
50
51 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698