OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/output/delegating_renderer.h" | 5 #include "cc/output/delegating_renderer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 capabilities_.allow_rasterize_on_demand = false; | 68 capabilities_.allow_rasterize_on_demand = false; |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 DelegatingRenderer::~DelegatingRenderer() {} | 72 DelegatingRenderer::~DelegatingRenderer() {} |
73 | 73 |
74 const RendererCapabilitiesImpl& DelegatingRenderer::Capabilities() const { | 74 const RendererCapabilitiesImpl& DelegatingRenderer::Capabilities() const { |
75 return capabilities_; | 75 return capabilities_; |
76 } | 76 } |
77 | 77 |
78 bool DelegatingRenderer::CanReadPixels() const { return false; } | |
79 | |
80 static ResourceProvider::ResourceId AppendToArray( | 78 static ResourceProvider::ResourceId AppendToArray( |
81 ResourceProvider::ResourceIdArray* array, | 79 ResourceProvider::ResourceIdArray* array, |
82 ResourceProvider::ResourceId id) { | 80 ResourceProvider::ResourceId id) { |
83 array->push_back(id); | 81 array->push_back(id); |
84 return id; | 82 return id; |
85 } | 83 } |
86 | 84 |
87 void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, | 85 void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, |
88 float device_scale_factor, | 86 float device_scale_factor, |
89 const gfx::Rect& device_viewport_rect, | 87 const gfx::Rect& device_viewport_rect, |
(...skipping 21 matching lines...) Expand all Loading... |
111 } | 109 } |
112 | 110 |
113 void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { | 111 void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { |
114 TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers"); | 112 TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers"); |
115 CompositorFrame compositor_frame; | 113 CompositorFrame compositor_frame; |
116 compositor_frame.metadata = metadata; | 114 compositor_frame.metadata = metadata; |
117 compositor_frame.delegated_frame_data = delegated_frame_data_.Pass(); | 115 compositor_frame.delegated_frame_data = delegated_frame_data_.Pass(); |
118 output_surface_->SwapBuffers(&compositor_frame); | 116 output_surface_->SwapBuffers(&compositor_frame); |
119 } | 117 } |
120 | 118 |
121 void DelegatingRenderer::GetFramebufferPixels(void* pixels, | |
122 const gfx::Rect& rect) { | |
123 NOTREACHED(); | |
124 } | |
125 | |
126 void DelegatingRenderer::ReceiveSwapBuffersAck( | 119 void DelegatingRenderer::ReceiveSwapBuffersAck( |
127 const CompositorFrameAck& ack) { | 120 const CompositorFrameAck& ack) { |
128 resource_provider_->ReceiveReturnsFromParent(ack.resources); | 121 resource_provider_->ReceiveReturnsFromParent(ack.resources); |
129 } | 122 } |
130 | 123 |
131 bool DelegatingRenderer::IsContextLost() { | 124 bool DelegatingRenderer::IsContextLost() { |
132 ContextProvider* context_provider = output_surface_->context_provider(); | 125 ContextProvider* context_provider = output_surface_->context_provider(); |
133 if (!context_provider) | 126 if (!context_provider) |
134 return false; | 127 return false; |
135 return context_provider->IsContextLost(); | 128 return context_provider->IsContextLost(); |
(...skipping 28 matching lines...) Expand all Loading... |
164 gpu::ManagedMemoryStats stats; | 157 gpu::ManagedMemoryStats stats; |
165 stats.bytes_required = bytes_visible; | 158 stats.bytes_required = bytes_visible; |
166 stats.bytes_nice_to_have = bytes_visible_and_nearby; | 159 stats.bytes_nice_to_have = bytes_visible_and_nearby; |
167 stats.bytes_allocated = bytes_allocated; | 160 stats.bytes_allocated = bytes_allocated; |
168 stats.backbuffer_requested = false; | 161 stats.backbuffer_requested = false; |
169 | 162 |
170 context_provider->ContextSupport()->SendManagedMemoryStats(stats); | 163 context_provider->ContextSupport()->SendManagedMemoryStats(stats); |
171 } | 164 } |
172 | 165 |
173 } // namespace cc | 166 } // namespace cc |
OLD | NEW |