| 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 <vector> | 10 #include <vector> |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 const base::CommandLine& command_line = | 571 const base::CommandLine& command_line = |
| 572 *base::CommandLine::ForCurrentProcess(); | 572 *base::CommandLine::ForCurrentProcess(); |
| 573 | 573 |
| 574 is_impl_side_painting_enabled_ = | 574 is_impl_side_painting_enabled_ = |
| 575 !command_line.HasSwitch(switches::kDisableImplSidePainting); | 575 !command_line.HasSwitch(switches::kDisableImplSidePainting); |
| 576 cc_blink::WebLayerImpl::SetImplSidePaintingEnabled( | 576 cc_blink::WebLayerImpl::SetImplSidePaintingEnabled( |
| 577 is_impl_side_painting_enabled_); | 577 is_impl_side_painting_enabled_); |
| 578 | 578 |
| 579 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy); | 579 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy); |
| 580 is_one_copy_enabled_ = !command_line.HasSwitch(switches::kDisableOneCopy); | 580 is_one_copy_enabled_ = !command_line.HasSwitch(switches::kDisableOneCopy); |
| 581 have_persistent_gpu_memory_buffers_ = |
| 582 command_line.HasSwitch(switches::kUsePersistentGpuMemoryBuffers); |
| 581 | 583 |
| 582 #if defined(OS_MACOSX) && !defined(OS_IOS) | 584 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 583 is_elastic_overscroll_enabled_ = base::mac::IsOSLionOrLater(); | 585 is_elastic_overscroll_enabled_ = base::mac::IsOSLionOrLater(); |
| 584 if (is_elastic_overscroll_enabled_) { | 586 if (is_elastic_overscroll_enabled_) { |
| 585 base::ScopedCFTypeRef<CFStringRef> key( | 587 base::ScopedCFTypeRef<CFStringRef> key( |
| 586 base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding")); | 588 base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding")); |
| 587 Boolean key_exists = false; | 589 Boolean key_exists = false; |
| 588 Boolean value = CFPreferencesGetAppBooleanValue( | 590 Boolean value = CFPreferencesGetAppBooleanValue( |
| 589 key, kCFPreferencesCurrentApplication, &key_exists); | 591 key, kCFPreferencesCurrentApplication, &key_exists); |
| 590 if (key_exists && !value) | 592 if (key_exists && !value) |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 } | 1418 } |
| 1417 | 1419 |
| 1418 bool RenderThreadImpl::IsZeroCopyEnabled() { | 1420 bool RenderThreadImpl::IsZeroCopyEnabled() { |
| 1419 return is_zero_copy_enabled_; | 1421 return is_zero_copy_enabled_; |
| 1420 } | 1422 } |
| 1421 | 1423 |
| 1422 bool RenderThreadImpl::IsOneCopyEnabled() { | 1424 bool RenderThreadImpl::IsOneCopyEnabled() { |
| 1423 return is_one_copy_enabled_; | 1425 return is_one_copy_enabled_; |
| 1424 } | 1426 } |
| 1425 | 1427 |
| 1428 bool RenderThreadImpl::HavePersistentGpuMemoryBuffers() { |
| 1429 return have_persistent_gpu_memory_buffers_; |
| 1430 } |
| 1431 |
| 1426 bool RenderThreadImpl::IsElasticOverscrollEnabled() { | 1432 bool RenderThreadImpl::IsElasticOverscrollEnabled() { |
| 1427 return is_elastic_overscroll_enabled_; | 1433 return is_elastic_overscroll_enabled_; |
| 1428 } | 1434 } |
| 1429 | 1435 |
| 1430 uint32 RenderThreadImpl::GetImageTextureTarget() { | 1436 uint32 RenderThreadImpl::GetImageTextureTarget() { |
| 1431 return use_image_texture_target_; | 1437 return use_image_texture_target_; |
| 1432 } | 1438 } |
| 1433 | 1439 |
| 1434 scoped_refptr<base::SingleThreadTaskRunner> | 1440 scoped_refptr<base::SingleThreadTaskRunner> |
| 1435 RenderThreadImpl::GetCompositorMainThreadTaskRunner() { | 1441 RenderThreadImpl::GetCompositorMainThreadTaskRunner() { |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 } | 1898 } |
| 1893 | 1899 |
| 1894 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1900 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 1895 size_t erased = | 1901 size_t erased = |
| 1896 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1902 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 1897 routing_id_); | 1903 routing_id_); |
| 1898 DCHECK_EQ(1u, erased); | 1904 DCHECK_EQ(1u, erased); |
| 1899 } | 1905 } |
| 1900 | 1906 |
| 1901 } // namespace content | 1907 } // namespace content |
| OLD | NEW |