| Index: gpu/command_buffer/common/gpu_memory_buffer_support.cc
|
| diff --git a/gpu/command_buffer/service/image_factory.cc b/gpu/command_buffer/common/gpu_memory_buffer_support.cc
|
| similarity index 86%
|
| copy from gpu/command_buffer/service/image_factory.cc
|
| copy to gpu/command_buffer/common/gpu_memory_buffer_support.cc
|
| index fd06d3f69c16ba4561a6bcc0f3088b495b426013..8f8ebceecf454717ccfc147abbc6a67fead9baa7 100644
|
| --- a/gpu/command_buffer/service/image_factory.cc
|
| +++ b/gpu/command_buffer/common/gpu_memory_buffer_support.cc
|
| @@ -1,15 +1,17 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Copyright 2016 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 "gpu/command_buffer/service/image_factory.h"
|
| +#include "gpu/command_buffer/common/gpu_memory_buffer_support.h"
|
|
|
| +#include "base/logging.h"
|
| #include "gpu/command_buffer/common/capabilities.h"
|
| #include "ui/gl/gl_bindings.h"
|
|
|
| namespace gpu {
|
|
|
| namespace {
|
| +
|
| gfx::BufferFormat BufferFormatForInternalFormat(unsigned internalformat) {
|
| switch (internalformat) {
|
| case GL_RED:
|
| @@ -44,15 +46,7 @@ gfx::BufferFormat BufferFormatForInternalFormat(unsigned internalformat) {
|
|
|
| } // namespace
|
|
|
| -ImageFactory::ImageFactory() {
|
| -}
|
| -
|
| -ImageFactory::~ImageFactory() {
|
| -}
|
| -
|
| -// static
|
| -gfx::BufferFormat ImageFactory::DefaultBufferFormatForImageFormat(
|
| - unsigned internalformat) {
|
| +gfx::BufferFormat DefaultBufferFormatForImageFormat(unsigned internalformat) {
|
| switch (internalformat) {
|
| case GL_RGB:
|
| return gfx::BufferFormat::BGRX_8888;
|
| @@ -64,8 +58,7 @@ gfx::BufferFormat ImageFactory::DefaultBufferFormatForImageFormat(
|
| }
|
| }
|
|
|
| -// static
|
| -bool ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat(
|
| +bool IsImageFormatCompatibleWithGpuMemoryBufferFormat(
|
| unsigned internalformat,
|
| gfx::BufferFormat format) {
|
| switch (format) {
|
| @@ -91,10 +84,8 @@ bool ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat(
|
| return false;
|
| }
|
|
|
| -// static
|
| -bool ImageFactory::IsGpuMemoryBufferFormatSupported(
|
| - gfx::BufferFormat format,
|
| - const gpu::Capabilities& capabilities) {
|
| +bool IsGpuMemoryBufferFormatSupported(gfx::BufferFormat format,
|
| + const gpu::Capabilities& capabilities) {
|
| switch (format) {
|
| case gfx::BufferFormat::ATC:
|
| case gfx::BufferFormat::ATCIA:
|
| @@ -125,10 +116,8 @@ bool ImageFactory::IsGpuMemoryBufferFormatSupported(
|
| return false;
|
| }
|
|
|
| -// static
|
| -bool ImageFactory::IsImageSizeValidForGpuMemoryBufferFormat(
|
| - const gfx::Size& size,
|
| - gfx::BufferFormat format) {
|
| +bool IsImageSizeValidForGpuMemoryBufferFormat(const gfx::Size& size,
|
| + gfx::BufferFormat format) {
|
| switch (format) {
|
| case gfx::BufferFormat::ATC:
|
| case gfx::BufferFormat::ATCIA:
|
|
|