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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2107783003: Pass initial size and GPU preference via context attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gpu/ipc/common/OWNERS presubmit Created 4 years, 5 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
OLDNEW
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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 attributes.stencil_size = 0; 430 attributes.stencil_size = 0;
431 attributes.samples = 0; 431 attributes.samples = 0;
432 attributes.sample_buffers = 0; 432 attributes.sample_buffers = 0;
433 attributes.bind_generates_resource = false; 433 attributes.bind_generates_resource = false;
434 attributes.lose_context_when_out_of_memory = true; 434 attributes.lose_context_when_out_of_memory = true;
435 const bool automatic_flushes = false; 435 const bool automatic_flushes = false;
436 return make_scoped_refptr(new ContextProviderCommandBuffer( 436 return make_scoped_refptr(new ContextProviderCommandBuffer(
437 std::move(gpu_channel_host), stream_id, stream_priority, 437 std::move(gpu_channel_host), stream_id, stream_priority,
438 gpu::kNullSurfaceHandle, 438 gpu::kNullSurfaceHandle,
439 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext"), 439 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext"),
440 gl::PreferIntegratedGpu, automatic_flushes, support_locking, limits, 440 automatic_flushes, support_locking, limits, attributes, nullptr, type));
441 attributes, nullptr, type));
442 } 441 }
443 442
444 } // namespace 443 } // namespace
445 444
446 // For measuring memory usage after each task. Behind a command line flag. 445 // For measuring memory usage after each task. Behind a command line flag.
447 class MemoryObserver : public base::MessageLoop::TaskObserver { 446 class MemoryObserver : public base::MessageLoop::TaskObserver {
448 public: 447 public:
449 MemoryObserver() {} 448 MemoryObserver() {}
450 ~MemoryObserver() override {} 449 ~MemoryObserver() override {}
451 450
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 // The compositor context shares resources with the worker context unless 1874 // The compositor context shares resources with the worker context unless
1876 // the worker is async. 1875 // the worker is async.
1877 ContextProviderCommandBuffer* share_context = worker_context_provider.get(); 1876 ContextProviderCommandBuffer* share_context = worker_context_provider.get();
1878 if (IsAsyncWorkerContextEnabled()) 1877 if (IsAsyncWorkerContextEnabled())
1879 share_context = nullptr; 1878 share_context = nullptr;
1880 1879
1881 scoped_refptr<ContextProviderCommandBuffer> context_provider( 1880 scoped_refptr<ContextProviderCommandBuffer> context_provider(
1882 new ContextProviderCommandBuffer( 1881 new ContextProviderCommandBuffer(
1883 gpu_channel_host, gpu::GPU_STREAM_DEFAULT, 1882 gpu_channel_host, gpu::GPU_STREAM_DEFAULT,
1884 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, url, 1883 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, url,
1885 gl::PreferIntegratedGpu, automatic_flushes, support_locking, limits, 1884 automatic_flushes, support_locking, limits, attributes, share_context,
1886 attributes, share_context,
1887 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT)); 1885 command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT));
1888 1886
1889 if (layout_test_deps_) { 1887 if (layout_test_deps_) {
1890 return layout_test_deps_->CreateOutputSurface( 1888 return layout_test_deps_->CreateOutputSurface(
1891 std::move(gpu_channel_host), std::move(context_provider), 1889 std::move(gpu_channel_host), std::move(context_provider),
1892 std::move(worker_context_provider), this); 1890 std::move(worker_context_provider), this);
1893 } 1891 }
1894 1892
1895 #if defined(OS_ANDROID) 1893 #if defined(OS_ANDROID)
1896 if (sync_compositor_message_filter_) { 1894 if (sync_compositor_message_filter_) {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
2204 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2202 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2205 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2203 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2206 2204
2207 blink::mainThreadIsolate()->MemoryPressureNotification( 2205 blink::mainThreadIsolate()->MemoryPressureNotification(
2208 v8_memory_pressure_level); 2206 v8_memory_pressure_level);
2209 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2207 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2210 v8_memory_pressure_level); 2208 v8_memory_pressure_level);
2211 } 2209 }
2212 2210
2213 } // namespace content 2211 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698