OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 attributes.stencil_size = 0; | 445 attributes.stencil_size = 0; |
446 attributes.samples = 0; | 446 attributes.samples = 0; |
447 attributes.sample_buffers = 0; | 447 attributes.sample_buffers = 0; |
448 attributes.bind_generates_resource = false; | 448 attributes.bind_generates_resource = false; |
449 attributes.lose_context_when_out_of_memory = true; | 449 attributes.lose_context_when_out_of_memory = true; |
450 const bool automatic_flushes = false; | 450 const bool automatic_flushes = false; |
451 return make_scoped_refptr(new ContextProviderCommandBuffer( | 451 return make_scoped_refptr(new ContextProviderCommandBuffer( |
452 std::move(gpu_channel_host), stream_id, stream_priority, | 452 std::move(gpu_channel_host), stream_id, stream_priority, |
453 gpu::kNullSurfaceHandle, | 453 gpu::kNullSurfaceHandle, |
454 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext"), | 454 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext"), |
455 gl::PreferIntegratedGpu, automatic_flushes, support_locking, limits, | 455 automatic_flushes, support_locking, limits, attributes, nullptr, type)); |
456 attributes, nullptr, type)); | |
457 } | 456 } |
458 | 457 |
459 } // namespace | 458 } // namespace |
460 | 459 |
461 // For measuring memory usage after each task. Behind a command line flag. | 460 // For measuring memory usage after each task. Behind a command line flag. |
462 class MemoryObserver : public base::MessageLoop::TaskObserver { | 461 class MemoryObserver : public base::MessageLoop::TaskObserver { |
463 public: | 462 public: |
464 MemoryObserver() {} | 463 MemoryObserver() {} |
465 ~MemoryObserver() override {} | 464 ~MemoryObserver() override {} |
466 | 465 |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1899 // The compositor context shares resources with the worker context unless | 1898 // The compositor context shares resources with the worker context unless |
1900 // the worker is async. | 1899 // the worker is async. |
1901 ContextProviderCommandBuffer* share_context = worker_context_provider.get(); | 1900 ContextProviderCommandBuffer* share_context = worker_context_provider.get(); |
1902 if (IsAsyncWorkerContextEnabled()) | 1901 if (IsAsyncWorkerContextEnabled()) |
1903 share_context = nullptr; | 1902 share_context = nullptr; |
1904 | 1903 |
1905 scoped_refptr<ContextProviderCommandBuffer> context_provider( | 1904 scoped_refptr<ContextProviderCommandBuffer> context_provider( |
1906 new ContextProviderCommandBuffer( | 1905 new ContextProviderCommandBuffer( |
1907 gpu_channel_host, gpu::GPU_STREAM_DEFAULT, | 1906 gpu_channel_host, gpu::GPU_STREAM_DEFAULT, |
1908 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, url, | 1907 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, url, |
1909 gl::PreferIntegratedGpu, automatic_flushes, support_locking, limits, | 1908 automatic_flushes, support_locking, limits, attributes, share_context, |
1910 attributes, share_context, | |
1911 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT)); | 1909 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT)); |
1912 | 1910 |
1913 if (layout_test_deps_) { | 1911 if (layout_test_deps_) { |
1914 return layout_test_deps_->CreateOutputSurface( | 1912 return layout_test_deps_->CreateOutputSurface( |
1915 std::move(gpu_channel_host), std::move(context_provider), | 1913 std::move(gpu_channel_host), std::move(context_provider), |
1916 std::move(worker_context_provider), this); | 1914 std::move(worker_context_provider), this); |
1917 } | 1915 } |
1918 | 1916 |
1919 #if defined(OS_ANDROID) | 1917 #if defined(OS_ANDROID) |
1920 if (sync_compositor_message_filter_) { | 1918 if (sync_compositor_message_filter_) { |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) | 2226 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) |
2229 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; | 2227 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; |
2230 | 2228 |
2231 blink::mainThreadIsolate()->MemoryPressureNotification( | 2229 blink::mainThreadIsolate()->MemoryPressureNotification( |
2232 v8_memory_pressure_level); | 2230 v8_memory_pressure_level); |
2233 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2231 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
2234 v8_memory_pressure_level); | 2232 v8_memory_pressure_level); |
2235 } | 2233 } |
2236 | 2234 |
2237 } // namespace content | 2235 } // namespace content |
OLD | NEW |