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

Side by Side Diff: cc/output/gl_renderer.cc

Issue 2726263003: cc::ResourcePool - Re-use larger resources for smaller requests (Closed)
Patch Set: fix compile Created 3 years, 7 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
« no previous file with comments | « cc/base/switches.cc ('k') | cc/output/renderer_settings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 "cc/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 3439 matching lines...) Expand 10 before | Expand all | Expand 10 after
3450 gl_->DeleteFramebuffers(1, &temp_fbo); 3450 gl_->DeleteFramebuffers(1, &temp_fbo);
3451 } 3451 }
3452 3452
3453 void GLRenderer::ScheduleRenderPassDrawQuad( 3453 void GLRenderer::ScheduleRenderPassDrawQuad(
3454 const CALayerOverlay* ca_layer_overlay) { 3454 const CALayerOverlay* ca_layer_overlay) {
3455 DCHECK(ca_layer_overlay->rpdq); 3455 DCHECK(ca_layer_overlay->rpdq);
3456 3456
3457 if (!overlay_resource_pool_) { 3457 if (!overlay_resource_pool_) {
3458 overlay_resource_pool_ = ResourcePool::CreateForGpuMemoryBufferResources( 3458 overlay_resource_pool_ = ResourcePool::CreateForGpuMemoryBufferResources(
3459 resource_provider_, base::ThreadTaskRunnerHandle::Get().get(), 3459 resource_provider_, base::ThreadTaskRunnerHandle::Get().get(),
3460 gfx::BufferUsage::SCANOUT, base::TimeDelta::FromSeconds(3)); 3460 gfx::BufferUsage::SCANOUT, base::TimeDelta::FromSeconds(3),
3461 settings_->disallow_non_exact_resource_reuse);
3461 } 3462 }
3462 3463
3463 Resource* resource = nullptr; 3464 Resource* resource = nullptr;
3464 gfx::RectF new_bounds; 3465 gfx::RectF new_bounds;
3465 CopyRenderPassDrawQuadToOverlayResource(ca_layer_overlay, &resource, 3466 CopyRenderPassDrawQuadToOverlayResource(ca_layer_overlay, &resource,
3466 &new_bounds); 3467 &new_bounds);
3467 if (!resource || !resource->id()) 3468 if (!resource || !resource->id())
3468 return; 3469 return;
3469 3470
3470 pending_overlay_resources_.push_back( 3471 pending_overlay_resources_.push_back(
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
3608 return; 3609 return;
3609 3610
3610 // Report GPU overdraw as a percentage of |max_result|. 3611 // Report GPU overdraw as a percentage of |max_result|.
3611 TRACE_COUNTER1( 3612 TRACE_COUNTER1(
3612 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", 3613 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw",
3613 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / 3614 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) /
3614 max_result); 3615 max_result);
3615 } 3616 }
3616 3617
3617 } // namespace cc 3618 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/switches.cc ('k') | cc/output/renderer_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698