| Index: cc/resources/resource_provider.h
|
| diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
|
| index d5b57127c205db172299d6cc7048e747779e56a8..8751ce2110c34e0484ddcf8fe144a5f06b92e334 100644
|
| --- a/cc/resources/resource_provider.h
|
| +++ b/cc/resources/resource_provider.h
|
| @@ -33,6 +33,7 @@
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
| #include "third_party/skia/include/core/SkCanvas.h"
|
| #include "ui/gfx/geometry/size.h"
|
| +#include "ui/gfx/gpu_memory_buffer.h"
|
|
|
| class GrContext;
|
|
|
| @@ -44,7 +45,6 @@ class GLES2Interface;
|
| }
|
|
|
| namespace gfx {
|
| -class GpuMemoryBuffer;
|
| class Rect;
|
| class Vector2d;
|
| }
|
| @@ -84,8 +84,7 @@ class CC_EXPORT ResourceProvider {
|
| BlockingTaskRunner* blocking_main_thread_task_runner,
|
| int highp_threshold_min,
|
| bool use_rgba_4444_texture_format,
|
| - size_t id_allocation_chunk_size,
|
| - bool use_persistent_map_for_gpu_memory_buffers);
|
| + size_t id_allocation_chunk_size);
|
| virtual ~ResourceProvider();
|
|
|
| void DidLoseOutputSurface() { lost_output_surface_ = true; }
|
| @@ -100,8 +99,8 @@ class CC_EXPORT ResourceProvider {
|
| }
|
| ResourceFormat yuv_resource_format() const { return yuv_resource_format_; }
|
| bool use_sync_query() const { return use_sync_query_; }
|
| - bool use_persistent_map_for_gpu_memory_buffers() const {
|
| - return use_persistent_map_for_gpu_memory_buffers_;
|
| + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() {
|
| + return gpu_memory_buffer_manager_;
|
| }
|
| size_t num_resources() const { return resources_.size(); }
|
|
|
| @@ -422,15 +421,8 @@ class CC_EXPORT ResourceProvider {
|
| // Indicates if we can currently lock this resource for write.
|
| bool CanLockForWrite(ResourceId id);
|
|
|
| - // Copy |rect| pixels from source to destination.
|
| - void CopyResource(ResourceId source_id,
|
| - ResourceId dest_id,
|
| - const gfx::Rect& rect);
|
| -
|
| void WaitSyncPointIfNeeded(ResourceId id);
|
|
|
| - void WaitReadLockIfNeeded(ResourceId id);
|
| -
|
| static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl);
|
|
|
| OutputSurface* output_surface() { return output_surface_; }
|
| @@ -444,8 +436,7 @@ class CC_EXPORT ResourceProvider {
|
| BlockingTaskRunner* blocking_main_thread_task_runner,
|
| int highp_threshold_min,
|
| bool use_rgba_4444_texture_format,
|
| - size_t id_allocation_chunk_size,
|
| - bool use_persistent_map_for_gpu_memory_buffers);
|
| + size_t id_allocation_chunk_size);
|
| void Initialize();
|
|
|
| private:
|
| @@ -600,9 +591,6 @@ class CC_EXPORT ResourceProvider {
|
| scoped_ptr<IdAllocator> buffer_id_allocator_;
|
|
|
| bool use_sync_query_;
|
| - bool use_persistent_map_for_gpu_memory_buffers_;
|
| - // Fence used for CopyResource if CHROMIUM_sync_query is not supported.
|
| - scoped_refptr<SynchronousFence> synchronous_fence_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
|
| };
|
| @@ -662,6 +650,26 @@ inline GLenum GLInternalFormat(ResourceFormat format) {
|
| return GLDataFormat(format);
|
| }
|
|
|
| +inline gfx::GpuMemoryBuffer::Format ToGpuMemoryBufferFormat(
|
| + ResourceFormat format) {
|
| + switch (format) {
|
| + case RGBA_8888:
|
| + return gfx::GpuMemoryBuffer::RGBA_8888;
|
| + case BGRA_8888:
|
| + return gfx::GpuMemoryBuffer::BGRA_8888;
|
| + case RGBA_4444:
|
| + return gfx::GpuMemoryBuffer::RGBA_4444;
|
| + case ALPHA_8:
|
| + case LUMINANCE_8:
|
| + case RGB_565:
|
| + case ETC1:
|
| + case RED_8:
|
| + break;
|
| + }
|
| + NOTREACHED();
|
| + return gfx::GpuMemoryBuffer::RGBA_8888;
|
| +}
|
| +
|
| } // namespace cc
|
|
|
| #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
|
|
|