Add Apps.AppListSearchQueryLength UMA histogram.
[chromium-blink-merge.git] / cc / test / test_in_process_context_provider.h
blobbb56e57876d17cc80042337063344cd1bcb11f42
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_TEST_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_
6 #define CC_TEST_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_
8 #include "base/synchronization/lock.h"
9 #include "cc/output/context_provider.h"
10 #include "cc/test/test_gpu_memory_buffer_manager.h"
11 #include "cc/test/test_image_factory.h"
12 #include "skia/ext/refptr.h"
14 class GrContext;
16 namespace gpu {
17 class GLInProcessContext;
20 namespace cc {
22 scoped_ptr<gpu::GLInProcessContext> CreateTestInProcessContext();
23 scoped_ptr<gpu::GLInProcessContext> CreateTestInProcessContext(
24 TestGpuMemoryBufferManager* gpu_memory_buffer_manager,
25 TestImageFactory* image_factory);
27 class TestInProcessContextProvider : public ContextProvider {
28 public:
29 TestInProcessContextProvider();
31 bool BindToCurrentThread() override;
32 gpu::gles2::GLES2Interface* ContextGL() override;
33 gpu::ContextSupport* ContextSupport() override;
34 class GrContext* GrContext() override;
35 void InvalidateGrContext(uint32_t state) override;
36 void SetupLock() override;
37 base::Lock* GetLock() override;
38 Capabilities ContextCapabilities() override;
39 bool IsContextLost() override;
40 void VerifyContexts() override;
41 void DeleteCachedResources() override;
42 bool DestroyedOnMainThread() override;
43 void SetLostContextCallback(
44 const LostContextCallback& lost_context_callback) override;
45 void SetMemoryPolicyChangedCallback(
46 const MemoryPolicyChangedCallback& memory_policy_changed_callback)
47 override;
49 protected:
50 friend class base::RefCountedThreadSafe<TestInProcessContextProvider>;
51 ~TestInProcessContextProvider() override;
53 private:
54 TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
55 TestImageFactory image_factory_;
56 scoped_ptr<gpu::GLInProcessContext> context_;
57 skia::RefPtr<class GrContext> gr_context_;
58 base::Lock context_lock_;
61 } // namespace cc
63 #endif // CC_TEST_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_