| OLD | NEW |
| 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" |
| 11 #include "android_webview/browser/shared_renderer_state.h" | 11 #include "android_webview/browser/shared_renderer_state.h" |
| 12 #include "base/lazy_instance.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/threading/thread_local.h" |
| 13 #include "content/public/browser/android/synchronous_compositor.h" | 15 #include "content/public/browser/android/synchronous_compositor.h" |
| 14 | 16 |
| 15 struct AwDrawGLInfo; | 17 struct AwDrawGLInfo; |
| 16 | 18 |
| 17 namespace android_webview { | 19 namespace android_webview { |
| 18 | 20 |
| 19 class AwGLSurface; | 21 class AwGLSurface; |
| 20 class BrowserViewRendererClient; | 22 class BrowserViewRendererClient; |
| 21 | 23 |
| 22 namespace internal { | 24 namespace internal { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 namespace internal { | 56 namespace internal { |
| 55 | 57 |
| 56 class ScopedAllowGL { | 58 class ScopedAllowGL { |
| 57 public: | 59 public: |
| 58 ScopedAllowGL(); | 60 ScopedAllowGL(); |
| 59 ~ScopedAllowGL(); | 61 ~ScopedAllowGL(); |
| 60 | 62 |
| 61 static bool IsAllowed(); | 63 static bool IsAllowed(); |
| 62 | 64 |
| 63 private: | 65 private: |
| 64 static bool allow_gl; | 66 static base::LazyInstance<base::ThreadLocalBoolean> allow_gl; |
| 65 | 67 |
| 66 DISALLOW_COPY_AND_ASSIGN(ScopedAllowGL); | 68 DISALLOW_COPY_AND_ASSIGN(ScopedAllowGL); |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 // TODO(boliu): Teach this class about RT. | 71 // TODO(boliu): Teach this class about RT. |
| 70 class DeferredGpuCommandService | 72 class DeferredGpuCommandService |
| 71 : public gpu::InProcessCommandBuffer::Service, | 73 : public gpu::InProcessCommandBuffer::Service, |
| 72 public base::RefCountedThreadSafe<DeferredGpuCommandService> { | 74 public base::RefCountedThreadSafe<DeferredGpuCommandService> { |
| 73 public: | 75 public: |
| 74 DeferredGpuCommandService(); | 76 DeferredGpuCommandService(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 96 | 98 |
| 97 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 99 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 98 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); | 100 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 } // namespace internal | 103 } // namespace internal |
| 102 | 104 |
| 103 } // namespace android_webview | 105 } // namespace android_webview |
| 104 | 106 |
| 105 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ | 107 #endif // ANDROID_WEBVIEW_BROWSER_HARDWARE_RENDERER_H_ |
| OLD | NEW |