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

Side by Side Diff: content/common/gpu/client/context_provider_command_buffer.h

Issue 2408513002: Move memory observer off OutputSurface/CompositorFrameSink (Closed)
Patch Set: memoryobs-contextprovider: . Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ 5 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_
6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ 6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/single_thread_task_runner.h" 14 #include "base/single_thread_task_runner.h"
15 #include "base/synchronization/lock.h" 15 #include "base/synchronization/lock.h"
16 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
17 #include "base/trace_event/memory_dump_provider.h"
17 #include "cc/output/context_provider.h" 18 #include "cc/output/context_provider.h"
18 #include "content/common/content_export.h" 19 #include "content/common/content_export.h"
19 #include "content/common/gpu/client/command_buffer_metrics.h" 20 #include "content/common/gpu/client/command_buffer_metrics.h"
20 #include "gpu/command_buffer/client/shared_memory_limits.h" 21 #include "gpu/command_buffer/client/shared_memory_limits.h"
21 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 22 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
22 #include "gpu/ipc/common/gpu_stream_constants.h" 23 #include "gpu/ipc/common/gpu_stream_constants.h"
23 #include "gpu/ipc/common/surface_handle.h" 24 #include "gpu/ipc/common/surface_handle.h"
24 #include "ui/gl/gpu_preference.h" 25 #include "ui/gl/gpu_preference.h"
25 #include "url/gurl.h" 26 #include "url/gurl.h"
26 27
(...skipping 11 matching lines...) Expand all
38 namespace skia_bindings { 39 namespace skia_bindings {
39 class GrContextForGLES2Interface; 40 class GrContextForGLES2Interface;
40 } 41 }
41 42
42 namespace content { 43 namespace content {
43 class WebGraphicsContext3DCommandBufferImpl; 44 class WebGraphicsContext3DCommandBufferImpl;
44 45
45 // Implementation of cc::ContextProvider that provides a GL implementation over 46 // Implementation of cc::ContextProvider that provides a GL implementation over
46 // command buffer to the GPU process. 47 // command buffer to the GPU process.
47 class CONTENT_EXPORT ContextProviderCommandBuffer 48 class CONTENT_EXPORT ContextProviderCommandBuffer
48 : NON_EXPORTED_BASE(public cc::ContextProvider) { 49 : NON_EXPORTED_BASE(public cc::ContextProvider),
50 public base::trace_event::MemoryDumpProvider {
49 public: 51 public:
50 ContextProviderCommandBuffer( 52 ContextProviderCommandBuffer(
51 scoped_refptr<gpu::GpuChannelHost> channel, 53 scoped_refptr<gpu::GpuChannelHost> channel,
52 int32_t stream_id, 54 int32_t stream_id,
53 gpu::GpuStreamPriority stream_priority, 55 gpu::GpuStreamPriority stream_priority,
54 gpu::SurfaceHandle surface_handle, 56 gpu::SurfaceHandle surface_handle,
55 const GURL& active_url, 57 const GURL& active_url,
56 bool automatic_flushes, 58 bool automatic_flushes,
57 bool support_locking, 59 bool support_locking,
58 const gpu::SharedMemoryLimits& memory_limits, 60 const gpu::SharedMemoryLimits& memory_limits,
(...skipping 12 matching lines...) Expand all
71 gpu::gles2::GLES2Interface* ContextGL() override; 73 gpu::gles2::GLES2Interface* ContextGL() override;
72 gpu::ContextSupport* ContextSupport() override; 74 gpu::ContextSupport* ContextSupport() override;
73 class GrContext* GrContext() override; 75 class GrContext* GrContext() override;
74 cc::ContextCacheController* CacheController() override; 76 cc::ContextCacheController* CacheController() override;
75 void InvalidateGrContext(uint32_t state) override; 77 void InvalidateGrContext(uint32_t state) override;
76 base::Lock* GetLock() override; 78 base::Lock* GetLock() override;
77 gpu::Capabilities ContextCapabilities() override; 79 gpu::Capabilities ContextCapabilities() override;
78 void SetLostContextCallback( 80 void SetLostContextCallback(
79 const LostContextCallback& lost_context_callback) override; 81 const LostContextCallback& lost_context_callback) override;
80 82
83 // base::trace_event::MemoryDumpProvider implementation.
84 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
85 base::trace_event::ProcessMemoryDump* pmd) override;
86
81 // Set the default task runner for command buffers to use for handling IPCs. 87 // Set the default task runner for command buffers to use for handling IPCs.
82 // If not specified, this will be the ThreadTaskRunner for the thread on 88 // If not specified, this will be the ThreadTaskRunner for the thread on
83 // which BindToThread is called. 89 // which BindToThread is called.
84 void SetDefaultTaskRunner( 90 void SetDefaultTaskRunner(
85 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner); 91 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner);
86 92
87 protected: 93 protected:
88 ~ContextProviderCommandBuffer() override; 94 ~ContextProviderCommandBuffer() override;
89 95
90 void OnLostContext(); 96 void OnLostContext();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; 135 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_;
130 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; 136 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_;
131 std::unique_ptr<cc::ContextCacheController> cache_controller_; 137 std::unique_ptr<cc::ContextCacheController> cache_controller_;
132 138
133 LostContextCallback lost_context_callback_; 139 LostContextCallback lost_context_callback_;
134 }; 140 };
135 141
136 } // namespace content 142 } // namespace content
137 143
138 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ 144 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_
OLDNEW
« no previous file with comments | « cc/output/output_surface.cc ('k') | content/common/gpu/client/context_provider_command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698