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

Side by Side Diff: cc/test/test_context_provider.h

Issue 110883015: Add preliminary support for hw-accelerated tile rasterization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added unit tests Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 CC_TEST_TEST_CONTEXT_PROVIDER_H_ 5 #ifndef CC_TEST_TEST_CONTEXT_PROVIDER_H_
6 #define CC_TEST_TEST_CONTEXT_PROVIDER_H_ 6 #define CC_TEST_TEST_CONTEXT_PROVIDER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "base/synchronization/lock.h" 11 #include "base/synchronization/lock.h"
12 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
13 #include "cc/output/context_provider.h" 13 #include "cc/output/context_provider.h"
14 #include "cc/test/test_context_support.h" 14 #include "cc/test/test_context_support.h"
15 #include "gpu/command_buffer/client/gles2_interface_stub.h" 15 #include "gpu/command_buffer/client/gles2_interface_stub.h"
16 #include "skia/ext/refptr.h"
16 17
17 namespace blink { class WebGraphicsContext3D; } 18 namespace blink { class WebGraphicsContext3D; }
18 19
19 namespace cc { 20 namespace cc {
20 class TestWebGraphicsContext3D; 21 class TestWebGraphicsContext3D;
21 class TestGLES2Interface; 22 class TestGLES2Interface;
22 23
23 class TestContextProvider : public ContextProvider { 24 class TestContextProvider : public ContextProvider {
24 public: 25 public:
25 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)> 26 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 explicit TestContextProvider(scoped_ptr<TestWebGraphicsContext3D> context); 62 explicit TestContextProvider(scoped_ptr<TestWebGraphicsContext3D> context);
62 virtual ~TestContextProvider(); 63 virtual ~TestContextProvider();
63 64
64 private: 65 private:
65 void OnLostContext(); 66 void OnLostContext();
66 67
67 TestContextSupport support_; 68 TestContextSupport support_;
68 69
69 scoped_ptr<TestWebGraphicsContext3D> context3d_; 70 scoped_ptr<TestWebGraphicsContext3D> context3d_;
70 scoped_ptr<TestGLES2Interface> context_gl_; 71 scoped_ptr<TestGLES2Interface> context_gl_;
72 skia::RefPtr<class GrContext> gr_context_;
vmpstr 2014/01/06 19:15:45 You should just forward declare at the top? I don'
alokp 2014/01/06 22:05:24 I will just follow the convention used in the base
71 bool bound_; 73 bool bound_;
72 74
73 base::ThreadChecker main_thread_checker_; 75 base::ThreadChecker main_thread_checker_;
74 base::ThreadChecker context_thread_checker_; 76 base::ThreadChecker context_thread_checker_;
75 77
76 base::Lock destroyed_lock_; 78 base::Lock destroyed_lock_;
77 bool destroyed_; 79 bool destroyed_;
78 80
79 LostContextCallback lost_context_callback_; 81 LostContextCallback lost_context_callback_;
80 MemoryPolicyChangedCallback memory_policy_changed_callback_; 82 MemoryPolicyChangedCallback memory_policy_changed_callback_;
81 83
82 class LostContextCallbackProxy; 84 class LostContextCallbackProxy;
83 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; 85 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_;
84 86
85 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; 87 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_;
86 88
87 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); 89 DISALLOW_COPY_AND_ASSIGN(TestContextProvider);
88 }; 90 };
89 91
90 } // namespace cc 92 } // namespace cc
91 93
92 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ 94 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_
93 95
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698