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/common/gpu/gpu_memory_manager.h" | 5 #include "content/common/gpu/gpu_memory_manager.h" |
6 | 6 |
7 #if defined(ENABLE_GPU) | 7 #if defined(ENABLE_GPU) |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
467 if (client_state->has_surface) { | 467 if (client_state->has_surface) { |
468 allocation.browser_allocation.suggest_have_frontbuffer = | 468 allocation.browser_allocation.suggest_have_frontbuffer = |
469 !client_state->hibernated; | 469 !client_state->hibernated; |
470 | 470 |
471 // Set the state when visible. | 471 // Set the state when visible. |
472 allocation.renderer_allocation.bytes_limit_when_visible = | 472 allocation.renderer_allocation.bytes_limit_when_visible = |
473 bytes_limit_when_visible; | 473 bytes_limit_when_visible; |
474 allocation.renderer_allocation.priority_cutoff_when_visible = | 474 allocation.renderer_allocation.priority_cutoff_when_visible = |
475 GpuMemoryAllocationForRenderer::kPriorityCutoffAllowEverything; | 475 GpuMemoryAllocationForRenderer::kPriorityCutoffAllowEverything; |
476 | 476 |
477 // Expermient to determine if aggressively discarding tiles on OS X | |
vangelis
2012/12/08 01:07:02
typo: experiment
nit: Ideally you'll want to merg
| |
478 // results in greater stability. | |
479 #if defined(OS_MACOSX) | |
480 allocation.renderer_allocation.priority_cutoff_when_visible = | |
481 GpuMemoryAllocationForRenderer::kPriorityCutoffAllowNiceToHave; | |
482 #endif | |
483 | |
477 // Set the state when backgrounded. | 484 // Set the state when backgrounded. |
478 bool allow_allocation_when_backgrounded = false; | 485 bool allow_allocation_when_backgrounded = false; |
479 if (client_state->visible) { | 486 if (client_state->visible) { |
480 // If the client is visible, then allow it to keep its textures, should | 487 // If the client is visible, then allow it to keep its textures, should |
481 // it be backgrounded, but only if all textures required to draw will | 488 // it be backgrounded, but only if all textures required to draw will |
482 // fit in total backgrounded memory limit. | 489 // fit in total backgrounded memory limit. |
483 allow_allocation_when_backgrounded = | 490 allow_allocation_when_backgrounded = |
484 client_state->managed_memory_stats.bytes_required < | 491 client_state->managed_memory_stats.bytes_required < |
485 bytes_backgrounded_available_gpu_memory_; | 492 bytes_backgrounded_available_gpu_memory_; |
486 } else { | 493 } else { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
604 : client(client), | 611 : client(client), |
605 has_surface(has_surface), | 612 has_surface(has_surface), |
606 visible(visible), | 613 visible(visible), |
607 last_used_time(last_used_time), | 614 last_used_time(last_used_time), |
608 hibernated(false) { | 615 hibernated(false) { |
609 } | 616 } |
610 | 617 |
611 } // namespace content | 618 } // namespace content |
612 | 619 |
613 #endif | 620 #endif |
OLD | NEW |