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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_x11.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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/gpu_memory_buffer_factory_x11.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory_x11.cc b/content/common/gpu/gpu_memory_buffer_factory_x11.cc
deleted file mode 100644
index bb9ef567020544b61f493f32f19bb516580424ab..0000000000000000000000000000000000000000
--- a/content/common/gpu/gpu_memory_buffer_factory_x11.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/common/gpu/gpu_memory_buffer_factory.h"
-
-#include "base/logging.h"
-#include "content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h"
-#include "gpu/command_buffer/service/image_factory.h"
-#include "ui/gl/gl_image.h"
-#include "ui/gl/gl_image_shared_memory.h"
-
-namespace content {
-namespace {
-
-class GpuMemoryBufferFactoryImpl : public GpuMemoryBufferFactory,
- public gpu::ImageFactory {
- public:
- // Overridden from GpuMemoryBufferFactory:
- gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
- const gfx::GpuMemoryBufferHandle& handle,
- const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format,
- gfx::GpuMemoryBuffer::Usage usage) override {
- switch (handle.type) {
- case gfx::X11_PIXMAP_BUFFER:
- x11_pixmap_factory_.CreateGpuMemoryBuffer(handle.global_id,
- handle.pixmap);
- return handle;
- default:
- NOTREACHED();
- return gfx::GpuMemoryBufferHandle();
- }
- }
- void DestroyGpuMemoryBuffer(
- const gfx::GpuMemoryBufferHandle& handle) override {
- switch (handle.type) {
- case gfx::X11_PIXMAP_BUFFER:
- x11_pixmap_factory_.DestroyGpuMemoryBuffer(handle.global_id);
- break;
- default:
- NOTREACHED();
- break;
- }
- }
- gpu::ImageFactory* AsImageFactory() override { return this; }
-
- // Overridden from gpu::GpuMemoryBufferFactory:
- scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
- const gfx::GpuMemoryBufferHandle& handle,
- const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format,
- unsigned internalformat,
- int client_id) override {
- switch (handle.type) {
- case gfx::SHARED_MEMORY_BUFFER: {
- scoped_refptr<gfx::GLImageSharedMemory> image(
- new gfx::GLImageSharedMemory(size, internalformat));
- if (!image->Initialize(handle, format))
- return NULL;
-
- return image;
- }
- case gfx::X11_PIXMAP_BUFFER:
- // Verify that client is the owner of the buffer we're about to use.
- if (handle.global_id.secondary_id != client_id)
- return scoped_refptr<gfx::GLImage>();
-
- return x11_pixmap_factory_.CreateImageForGpuMemoryBuffer(
- handle.global_id, size, internalformat);
- default:
- NOTREACHED();
- return scoped_refptr<gfx::GLImage>();
- }
- }
-
- private:
- GpuMemoryBufferFactoryX11Pixmap x11_pixmap_factory_;
-};
-
-} // namespace
-
-// static
-scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::Create() {
- return make_scoped_ptr<GpuMemoryBufferFactory>(
- new GpuMemoryBufferFactoryImpl);
-}
-
-} // namespace content
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_linux.cc ('k') | content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698