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

Side by Side Diff: android_webview/browser/hardware_renderer.h

Issue 217813004: Make ShaderTranslatorCache thread safe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 8 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
« no previous file with comments | « no previous file | android_webview/browser/hardware_renderer.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_
6 #define ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "android_webview/browser/gl_view_renderer_manager.h" 10 #include "android_webview/browser/gl_view_renderer_manager.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // TODO(boliu): Teach this class about RT. 69 // TODO(boliu): Teach this class about RT.
70 class DeferredGpuCommandService 70 class DeferredGpuCommandService
71 : public gpu::InProcessCommandBuffer::Service, 71 : public gpu::InProcessCommandBuffer::Service,
72 public base::RefCountedThreadSafe<DeferredGpuCommandService> { 72 public base::RefCountedThreadSafe<DeferredGpuCommandService> {
73 public: 73 public:
74 DeferredGpuCommandService(); 74 DeferredGpuCommandService();
75 75
76 virtual void ScheduleTask(const base::Closure& task) OVERRIDE; 76 virtual void ScheduleTask(const base::Closure& task) OVERRIDE;
77 virtual void ScheduleIdleWork(const base::Closure& task) OVERRIDE; 77 virtual void ScheduleIdleWork(const base::Closure& task) OVERRIDE;
78 virtual bool UseVirtualizedGLContexts() OVERRIDE; 78 virtual bool UseVirtualizedGLContexts() OVERRIDE;
79 virtual scoped_refptr<gpu::gles2::ShaderTranslatorCache>
80 shader_translator_cache() OVERRIDE;
79 81
80 void RunTasks(); 82 void RunTasks();
81 83
82 virtual void AddRef() const OVERRIDE; 84 virtual void AddRef() const OVERRIDE;
83 virtual void Release() const OVERRIDE; 85 virtual void Release() const OVERRIDE;
84 86
85 protected: 87 protected:
86 virtual ~DeferredGpuCommandService(); 88 virtual ~DeferredGpuCommandService();
87 friend class base::RefCountedThreadSafe<DeferredGpuCommandService>; 89 friend class base::RefCountedThreadSafe<DeferredGpuCommandService>;
88 90
89 private: 91 private:
90 static void RequestProcessGLOnUIThread(); 92 static void RequestProcessGLOnUIThread();
91 93
92 base::Lock tasks_lock_; 94 base::Lock tasks_lock_;
93 std::queue<base::Closure> tasks_; 95 std::queue<base::Closure> tasks_;
96
97 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_;
94 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); 98 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService);
95 }; 99 };
96 100
97 } // namespace internal 101 } // namespace internal
98 102
99 } // namespace android_webview 103 } // namespace android_webview
100 104
101 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ 105 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/hardware_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698