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 #include "android_webview/browser/hardware_renderer.h" | 5 #include "android_webview/browser/hardware_renderer.h" |
6 | 6 |
7 #include "android_webview/browser/aw_gl_surface.h" | 7 #include "android_webview/browser/aw_gl_surface.h" |
8 #include "android_webview/browser/browser_view_renderer_client.h" | 8 #include "android_webview/browser/browser_view_renderer_client.h" |
9 #include "android_webview/browser/gl_view_renderer_manager.h" | 9 #include "android_webview/browser/gl_view_renderer_manager.h" |
10 #include "android_webview/browser/scoped_app_gl_state_restore.h" | 10 #include "android_webview/browser/scoped_app_gl_state_restore.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 return false; | 83 return false; |
84 } | 84 } |
85 | 85 |
86 // TODO(boliu): Handle context loss. | 86 // TODO(boliu): Handle context loss. |
87 if (last_egl_context_ != current_context) | 87 if (last_egl_context_ != current_context) |
88 DLOG(WARNING) << "EGLContextChanged"; | 88 DLOG(WARNING) << "EGLContextChanged"; |
89 | 89 |
90 ScopedAppGLStateRestore state_restore(ScopedAppGLStateRestore::MODE_DRAW); | 90 ScopedAppGLStateRestore state_restore(ScopedAppGLStateRestore::MODE_DRAW); |
91 internal::ScopedAllowGL allow_gl; | 91 internal::ScopedAllowGL allow_gl; |
92 | 92 |
93 if (draw_info->mode == AwDrawGLInfo::kModeProcess) | 93 if (draw_info->mode != AwDrawGLInfo::kModeDraw) |
hush (inactive)
2014/04/29 17:21:44
is it true that we only access the shared renderer
boliu
2014/04/29 17:33:53
Done.
| |
94 return false; | 94 return false; |
95 | 95 |
96 // Update memory budget. This will no-op in compositor if the policy has not | 96 // Update memory budget. This will no-op in compositor if the policy has not |
97 // changed since last draw. | 97 // changed since last draw. |
98 content::SynchronousCompositorMemoryPolicy policy; | 98 content::SynchronousCompositorMemoryPolicy policy; |
99 policy.bytes_limit = g_memory_multiplier * kBytesPerPixel * | 99 policy.bytes_limit = g_memory_multiplier * kBytesPerPixel * |
100 input.global_visible_rect.width() * | 100 input.global_visible_rect.width() * |
101 input.global_visible_rect.height(); | 101 input.global_visible_rect.height(); |
102 // Round up to a multiple of kMemoryAllocationStep. | 102 // Round up to a multiple of kMemoryAllocationStep. |
103 policy.bytes_limit = | 103 policy.bytes_limit = |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 base::RefCountedThreadSafe<DeferredGpuCommandService>::AddRef(); | 294 base::RefCountedThreadSafe<DeferredGpuCommandService>::AddRef(); |
295 } | 295 } |
296 | 296 |
297 void DeferredGpuCommandService::Release() const { | 297 void DeferredGpuCommandService::Release() const { |
298 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release(); | 298 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release(); |
299 } | 299 } |
300 | 300 |
301 } // namespace internal | 301 } // namespace internal |
302 | 302 |
303 } // namespace android_webview | 303 } // namespace android_webview |
OLD | NEW |