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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc

Issue 1240353002: ozone: rename to GpuMemoryBuffer(Factory|Impl)OzoneNativePixmap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits in comments Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc b/content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
deleted file mode 100644
index dfc0e38ee0b4b1c8518c922f1289fd658c00fc6a..0000000000000000000000000000000000000000
--- a/content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
+++ /dev/null
@@ -1,95 +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_ozone_native_buffer.h"
-
-#include "base/logging.h"
-#include "ui/gl/gl_image.h"
-#include "ui/ozone/public/ozone_platform.h"
-#include "ui/ozone/public/surface_factory_ozone.h"
-
-namespace content {
-namespace {
-
-const GpuMemoryBufferFactory::Configuration kSupportedConfigurations[] = {
- { gfx::GpuMemoryBuffer::BGRA_8888, gfx::GpuMemoryBuffer::SCANOUT },
- { gfx::GpuMemoryBuffer::RGBX_8888, gfx::GpuMemoryBuffer::SCANOUT }
-};
-
-} // namespace
-
-GpuMemoryBufferFactoryOzoneNativeBuffer::
- GpuMemoryBufferFactoryOzoneNativeBuffer() {
-}
-
-GpuMemoryBufferFactoryOzoneNativeBuffer::
- ~GpuMemoryBufferFactoryOzoneNativeBuffer() {
-}
-
-// static
-bool GpuMemoryBufferFactoryOzoneNativeBuffer::
- IsGpuMemoryBufferConfigurationSupported(gfx::GpuMemoryBuffer::Format format,
- gfx::GpuMemoryBuffer::Usage usage) {
- for (auto& configuration : kSupportedConfigurations) {
- if (configuration.format == format && configuration.usage == usage)
- return true;
- }
-
- return false;
-}
-
-void GpuMemoryBufferFactoryOzoneNativeBuffer::
- GetSupportedGpuMemoryBufferConfigurations(
- std::vector<Configuration>* configurations) {
- if (!ui::OzonePlatform::GetInstance()
- ->GetSurfaceFactoryOzone()
- ->CanCreateNativePixmap(ui::SurfaceFactoryOzone::SCANOUT))
- return;
-
- configurations->assign(
- kSupportedConfigurations,
- kSupportedConfigurations + arraysize(kSupportedConfigurations));
-}
-
-gfx::GpuMemoryBufferHandle
-GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer(
- gfx::GpuMemoryBufferId id,
- const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format,
- gfx::GpuMemoryBuffer::Usage usage,
- int client_id,
- gfx::PluginWindowHandle surface_handle) {
- if (!ozone_native_buffer_factory_.CreateGpuMemoryBuffer(
- id, size, format, usage, client_id, surface_handle)) {
- return gfx::GpuMemoryBufferHandle();
- }
- gfx::GpuMemoryBufferHandle handle;
- handle.type = gfx::OZONE_NATIVE_BUFFER;
- handle.id = id;
- return handle;
-}
-
-void GpuMemoryBufferFactoryOzoneNativeBuffer::DestroyGpuMemoryBuffer(
- gfx::GpuMemoryBufferId id,
- int client_id) {
- ozone_native_buffer_factory_.DestroyGpuMemoryBuffer(id, client_id);
-}
-
-gpu::ImageFactory* GpuMemoryBufferFactoryOzoneNativeBuffer::AsImageFactory() {
- return this;
-}
-
-scoped_refptr<gfx::GLImage>
-GpuMemoryBufferFactoryOzoneNativeBuffer::CreateImageForGpuMemoryBuffer(
- const gfx::GpuMemoryBufferHandle& handle,
- const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format,
- unsigned internalformat,
- int client_id) {
- DCHECK_EQ(handle.type, gfx::OZONE_NATIVE_BUFFER);
- return ozone_native_buffer_factory_.CreateImageForGpuMemoryBuffer(
- handle.id, size, format, internalformat, client_id);
-}
-
-} // namespace content

Powered by Google App Engine
This is Rietveld 408576698