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/direct_renderer.h" | 5 #include "cc/output/direct_renderer.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 | 128 |
129 DirectRenderer::DirectRenderer(RendererClient* client, | 129 DirectRenderer::DirectRenderer(RendererClient* client, |
130 OutputSurface* output_surface, | 130 OutputSurface* output_surface, |
131 ResourceProvider* resource_provider) | 131 ResourceProvider* resource_provider) |
132 : Renderer(client), | 132 : Renderer(client), |
133 output_surface_(output_surface), | 133 output_surface_(output_surface), |
134 resource_provider_(resource_provider) {} | 134 resource_provider_(resource_provider) {} |
135 | 135 |
136 DirectRenderer::~DirectRenderer() {} | 136 DirectRenderer::~DirectRenderer() {} |
137 | 137 |
138 bool DirectRenderer::CanReadPixels() const { return true; } | 138 bool DirectRenderer::CanReadPixels() const { |
139 return !output_surface_->IsLost(); | |
brianderson
2013/09/06 21:43:15
This hopefully fixes the mac_rel failure when losi
danakj
2013/09/06 21:45:57
This is kinda abuse of this method. It's really me
| |
140 } | |
139 | 141 |
140 void DirectRenderer::SetEnlargePassTextureAmountForTesting( | 142 void DirectRenderer::SetEnlargePassTextureAmountForTesting( |
141 gfx::Vector2d amount) { | 143 gfx::Vector2d amount) { |
142 enlarge_pass_texture_amount_ = amount; | 144 enlarge_pass_texture_amount_ = amount; |
143 } | 145 } |
144 | 146 |
145 void DirectRenderer::DecideRenderPassAllocationsForFrame( | 147 void DirectRenderer::DecideRenderPassAllocationsForFrame( |
146 const RenderPassList& render_passes_in_draw_order) { | 148 const RenderPassList& render_passes_in_draw_order) { |
147 if (!resource_provider_) | 149 if (!resource_provider_) |
148 return; | 150 return; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
413 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 415 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
414 return render_pass->output_rect.size(); | 416 return render_pass->output_rect.size(); |
415 } | 417 } |
416 | 418 |
417 // static | 419 // static |
418 GLenum DirectRenderer::RenderPassTextureFormat(const RenderPass* render_pass) { | 420 GLenum DirectRenderer::RenderPassTextureFormat(const RenderPass* render_pass) { |
419 return GL_RGBA; | 421 return GL_RGBA; |
420 } | 422 } |
421 | 423 |
422 } // namespace cc | 424 } // namespace cc |
OLD | NEW |