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

Side by Side Diff: cc/resources/resource_provider.cc

Issue 656263003: cc: Move GpuMemoryBufferManager interface to gpu namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn build fix 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 | « cc/resources/resource_provider.h ('k') | cc/surfaces/display.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/resources/resource_provider.h" 5 #include "cc/resources/resource_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
11 #include "base/debug/trace_event.h" 11 #include "base/debug/trace_event.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/strings/string_split.h" 13 #include "base/strings/string_split.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "cc/base/util.h" 15 #include "cc/base/util.h"
16 #include "cc/output/gl_renderer.h" // For the GLC() macro. 16 #include "cc/output/gl_renderer.h" // For the GLC() macro.
17 #include "cc/resources/gpu_memory_buffer_manager.h"
18 #include "cc/resources/platform_color.h" 17 #include "cc/resources/platform_color.h"
19 #include "cc/resources/returned_resource.h" 18 #include "cc/resources/returned_resource.h"
20 #include "cc/resources/shared_bitmap_manager.h" 19 #include "cc/resources/shared_bitmap_manager.h"
21 #include "cc/resources/texture_uploader.h" 20 #include "cc/resources/texture_uploader.h"
22 #include "cc/resources/transferable_resource.h" 21 #include "cc/resources/transferable_resource.h"
23 #include "gpu/GLES2/gl2extchromium.h" 22 #include "gpu/GLES2/gl2extchromium.h"
24 #include "gpu/command_buffer/client/gles2_interface.h" 23 #include "gpu/command_buffer/client/gles2_interface.h"
24 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
25 #include "third_party/khronos/GLES2/gl2.h" 25 #include "third_party/khronos/GLES2/gl2.h"
26 #include "third_party/khronos/GLES2/gl2ext.h" 26 #include "third_party/khronos/GLES2/gl2ext.h"
27 #include "third_party/skia/include/core/SkSurface.h" 27 #include "third_party/skia/include/core/SkSurface.h"
28 #include "third_party/skia/include/gpu/GrContext.h" 28 #include "third_party/skia/include/gpu/GrContext.h"
29 #include "ui/gfx/frame_time.h" 29 #include "ui/gfx/frame_time.h"
30 #include "ui/gfx/geometry/rect.h" 30 #include "ui/gfx/geometry/rect.h"
31 #include "ui/gfx/geometry/vector2d.h" 31 #include "ui/gfx/geometry/vector2d.h"
32 #include "ui/gfx/gpu_memory_buffer.h" 32 #include "ui/gfx/gpu_memory_buffer.h"
33 33
34 using gpu::gles2::GLES2Interface; 34 using gpu::gles2::GLES2Interface;
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 DCHECK(wrap_mode == GL_CLAMP_TO_EDGE || wrap_mode == GL_REPEAT); 400 DCHECK(wrap_mode == GL_CLAMP_TO_EDGE || wrap_mode == GL_REPEAT);
401 } 401 }
402 402
403 ResourceProvider::Child::Child() : marked_for_deletion(false) {} 403 ResourceProvider::Child::Child() : marked_for_deletion(false) {}
404 404
405 ResourceProvider::Child::~Child() {} 405 ResourceProvider::Child::~Child() {}
406 406
407 scoped_ptr<ResourceProvider> ResourceProvider::Create( 407 scoped_ptr<ResourceProvider> ResourceProvider::Create(
408 OutputSurface* output_surface, 408 OutputSurface* output_surface,
409 SharedBitmapManager* shared_bitmap_manager, 409 SharedBitmapManager* shared_bitmap_manager,
410 GpuMemoryBufferManager* gpu_memory_buffer_manager, 410 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
411 BlockingTaskRunner* blocking_main_thread_task_runner, 411 BlockingTaskRunner* blocking_main_thread_task_runner,
412 int highp_threshold_min, 412 int highp_threshold_min,
413 bool use_rgba_4444_texture_format, 413 bool use_rgba_4444_texture_format,
414 size_t id_allocation_chunk_size) { 414 size_t id_allocation_chunk_size) {
415 scoped_ptr<ResourceProvider> resource_provider( 415 scoped_ptr<ResourceProvider> resource_provider(
416 new ResourceProvider(output_surface, 416 new ResourceProvider(output_surface,
417 shared_bitmap_manager, 417 shared_bitmap_manager,
418 gpu_memory_buffer_manager, 418 gpu_memory_buffer_manager,
419 blocking_main_thread_task_runner, 419 blocking_main_thread_task_runner,
420 highp_threshold_min, 420 highp_threshold_min,
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 : SkSurface::kStandard_TextRenderMode; 1122 : SkSurface::kStandard_TextRenderMode;
1123 resource_->sk_surface = skia::AdoptRef(SkSurface::NewRenderTargetDirect( 1123 resource_->sk_surface = skia::AdoptRef(SkSurface::NewRenderTargetDirect(
1124 gr_texture->asRenderTarget(), text_render_mode)); 1124 gr_texture->asRenderTarget(), text_render_mode));
1125 } 1125 }
1126 return resource_->sk_surface.get(); 1126 return resource_->sk_surface.get();
1127 } 1127 }
1128 1128
1129 ResourceProvider::ResourceProvider( 1129 ResourceProvider::ResourceProvider(
1130 OutputSurface* output_surface, 1130 OutputSurface* output_surface,
1131 SharedBitmapManager* shared_bitmap_manager, 1131 SharedBitmapManager* shared_bitmap_manager,
1132 GpuMemoryBufferManager* gpu_memory_buffer_manager, 1132 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
1133 BlockingTaskRunner* blocking_main_thread_task_runner, 1133 BlockingTaskRunner* blocking_main_thread_task_runner,
1134 int highp_threshold_min, 1134 int highp_threshold_min,
1135 bool use_rgba_4444_texture_format, 1135 bool use_rgba_4444_texture_format,
1136 size_t id_allocation_chunk_size) 1136 size_t id_allocation_chunk_size)
1137 : output_surface_(output_surface), 1137 : output_surface_(output_surface),
1138 shared_bitmap_manager_(shared_bitmap_manager), 1138 shared_bitmap_manager_(shared_bitmap_manager),
1139 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), 1139 gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
1140 blocking_main_thread_task_runner_(blocking_main_thread_task_runner), 1140 blocking_main_thread_task_runner_(blocking_main_thread_task_runner),
1141 lost_output_surface_(false), 1141 lost_output_surface_(false),
1142 highp_threshold_min_(highp_threshold_min), 1142 highp_threshold_min_(highp_threshold_min),
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
2064 ContextProvider* context_provider = output_surface_->context_provider(); 2064 ContextProvider* context_provider = output_surface_->context_provider();
2065 return context_provider ? context_provider->ContextGL() : NULL; 2065 return context_provider ? context_provider->ContextGL() : NULL;
2066 } 2066 }
2067 2067
2068 class GrContext* ResourceProvider::GrContext() const { 2068 class GrContext* ResourceProvider::GrContext() const {
2069 ContextProvider* context_provider = output_surface_->context_provider(); 2069 ContextProvider* context_provider = output_surface_->context_provider();
2070 return context_provider ? context_provider->GrContext() : NULL; 2070 return context_provider ? context_provider->GrContext() : NULL;
2071 } 2071 }
2072 2072
2073 } // namespace cc 2073 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/surfaces/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698