| OLD | NEW |
| 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 3842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3853 } | 3853 } |
| 3854 gl_->ScheduleCALayerCHROMIUM( | 3854 gl_->ScheduleCALayerCHROMIUM( |
| 3855 texture_id, contents_rect, ca_layer_overlay.background_color, | 3855 texture_id, contents_rect, ca_layer_overlay.background_color, |
| 3856 ca_layer_overlay.edge_aa_mask, bounds_rect, filter); | 3856 ca_layer_overlay.edge_aa_mask, bounds_rect, filter); |
| 3857 } | 3857 } |
| 3858 | 3858 |
| 3859 // Take the number of copied render passes in this frame, and use 3 times that | 3859 // Take the number of copied render passes in this frame, and use 3 times that |
| 3860 // amount as the cache limit. | 3860 // amount as the cache limit. |
| 3861 if (overlay_resource_pool_) { | 3861 if (overlay_resource_pool_) { |
| 3862 overlay_resource_pool_->SetResourceUsageLimits( | 3862 overlay_resource_pool_->SetResourceUsageLimits( |
| 3863 std::numeric_limits<std::size_t>::max(), copied_render_pass_count * 3); | 3863 std::numeric_limits<std::size_t>::max(), copied_render_pass_count * 5); |
| 3864 } | 3864 } |
| 3865 } | 3865 } |
| 3866 | 3866 |
| 3867 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { | 3867 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { |
| 3868 if (frame->overlay_list.empty()) | 3868 if (frame->overlay_list.empty()) |
| 3869 return; | 3869 return; |
| 3870 | 3870 |
| 3871 OverlayCandidateList& overlays = frame->overlay_list; | 3871 OverlayCandidateList& overlays = frame->overlay_list; |
| 3872 for (const OverlayCandidate& overlay : overlays) { | 3872 for (const OverlayCandidate& overlay : overlays) { |
| 3873 unsigned texture_id = 0; | 3873 unsigned texture_id = 0; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4026 } | 4026 } |
| 4027 | 4027 |
| 4028 void GLRenderer::ScheduleRenderPassDrawQuad( | 4028 void GLRenderer::ScheduleRenderPassDrawQuad( |
| 4029 const CALayerOverlay* ca_layer_overlay, | 4029 const CALayerOverlay* ca_layer_overlay, |
| 4030 DrawingFrame* external_frame) { | 4030 DrawingFrame* external_frame) { |
| 4031 DCHECK(ca_layer_overlay->rpdq); | 4031 DCHECK(ca_layer_overlay->rpdq); |
| 4032 | 4032 |
| 4033 if (!overlay_resource_pool_) { | 4033 if (!overlay_resource_pool_) { |
| 4034 overlay_resource_pool_ = ResourcePool::CreateForGpuMemoryBufferResources( | 4034 overlay_resource_pool_ = ResourcePool::CreateForGpuMemoryBufferResources( |
| 4035 resource_provider_, base::ThreadTaskRunnerHandle::Get().get(), | 4035 resource_provider_, base::ThreadTaskRunnerHandle::Get().get(), |
| 4036 gfx::BufferUsage::SCANOUT); | 4036 gfx::BufferUsage::SCANOUT, base::TimeDelta::FromSeconds(3)); |
| 4037 } | 4037 } |
| 4038 | 4038 |
| 4039 Resource* resource = nullptr; | 4039 Resource* resource = nullptr; |
| 4040 gfx::RectF new_bounds; | 4040 gfx::RectF new_bounds; |
| 4041 CopyRenderPassDrawQuadToOverlayResource(ca_layer_overlay, &resource, | 4041 CopyRenderPassDrawQuadToOverlayResource(ca_layer_overlay, &resource, |
| 4042 external_frame, &new_bounds); | 4042 external_frame, &new_bounds); |
| 4043 if (!resource || !resource->id()) | 4043 if (!resource || !resource->id()) |
| 4044 return; | 4044 return; |
| 4045 | 4045 |
| 4046 pending_overlay_resources_.push_back( | 4046 pending_overlay_resources_.push_back( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 4073 | 4073 |
| 4074 gl_->ScheduleCALayerSharedStateCHROMIUM( | 4074 gl_->ScheduleCALayerSharedStateCHROMIUM( |
| 4075 ca_layer_overlay->shared_state->opacity, is_clipped, clip_rect, | 4075 ca_layer_overlay->shared_state->opacity, is_clipped, clip_rect, |
| 4076 sorting_context_id, gl_transform); | 4076 sorting_context_id, gl_transform); |
| 4077 gl_->ScheduleCALayerCHROMIUM( | 4077 gl_->ScheduleCALayerCHROMIUM( |
| 4078 texture_id, contents_rect, ca_layer_overlay->background_color, | 4078 texture_id, contents_rect, ca_layer_overlay->background_color, |
| 4079 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); | 4079 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); |
| 4080 } | 4080 } |
| 4081 | 4081 |
| 4082 } // namespace cc | 4082 } // namespace cc |
| OLD | NEW |