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

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: protect ShFinalize 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
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 gpu::gles2::ShaderTranslatorCache* shader_translator_cache() OVERRIDE;
79 80
80 void RunTasks(); 81 void RunTasks();
81 82
82 virtual void AddRef() const OVERRIDE; 83 virtual void AddRef() const OVERRIDE;
83 virtual void Release() const OVERRIDE; 84 virtual void Release() const OVERRIDE;
84 85
85 protected: 86 protected:
86 virtual ~DeferredGpuCommandService(); 87 virtual ~DeferredGpuCommandService();
87 friend class base::RefCountedThreadSafe<DeferredGpuCommandService>; 88 friend class base::RefCountedThreadSafe<DeferredGpuCommandService>;
88 89
89 private: 90 private:
90 static void RequestProcessGLOnUIThread(); 91 static void RequestProcessGLOnUIThread();
91 92
92 base::Lock tasks_lock_; 93 base::Lock tasks_lock_;
93 std::queue<base::Closure> tasks_; 94 std::queue<base::Closure> tasks_;
95
96 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_;
94 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); 97 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService);
95 }; 98 };
96 99
97 } // namespace internal 100 } // namespace internal
98 101
99 } // namespace android_webview 102 } // namespace android_webview
100 103
101 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ 104 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/hardware_renderer.cc » ('j') | gpu/command_buffer/service/in_process_command_buffer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698