| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 gfx::Size size = RenderPassTextureSize(render_pass); | 540 gfx::Size size = RenderPassTextureSize(render_pass); |
| 541 size.Enlarge(enlarge_pass_texture_amount_.x(), | 541 size.Enlarge(enlarge_pass_texture_amount_.x(), |
| 542 enlarge_pass_texture_amount_.y()); | 542 enlarge_pass_texture_amount_.y()); |
| 543 if (!texture->id()) { | 543 if (!texture->id()) { |
| 544 texture->Allocate(size, | 544 texture->Allocate(size, |
| 545 ResourceProvider::TEXTURE_HINT_IMMUTABLE_FRAMEBUFFER, | 545 ResourceProvider::TEXTURE_HINT_IMMUTABLE_FRAMEBUFFER, |
| 546 resource_provider_->best_texture_format()); | 546 resource_provider_->best_texture_format()); |
| 547 } | 547 } |
| 548 DCHECK(texture->id()); | 548 DCHECK(texture->id()); |
| 549 | 549 |
| 550 if (BindFramebufferToTexture(frame, texture, render_pass->output_rect)) { | 550 if (BindFramebufferToTexture(frame, texture)) { |
| 551 InitializeViewport(frame, render_pass->output_rect, | 551 InitializeViewport(frame, render_pass->output_rect, |
| 552 gfx::Rect(render_pass->output_rect.size()), | 552 gfx::Rect(render_pass->output_rect.size()), |
| 553 render_pass->output_rect.size()); | 553 render_pass->output_rect.size()); |
| 554 return true; | 554 return true; |
| 555 } | 555 } |
| 556 | 556 |
| 557 return false; | 557 return false; |
| 558 } | 558 } |
| 559 | 559 |
| 560 bool DirectRenderer::HasAllocatedResourcesForTesting(RenderPassId id) const { | 560 bool DirectRenderer::HasAllocatedResourcesForTesting(RenderPassId id) const { |
| 561 ScopedResource* texture = render_pass_textures_.get(id); | 561 ScopedResource* texture = render_pass_textures_.get(id); |
| 562 return texture && texture->id(); | 562 return texture && texture->id(); |
| 563 } | 563 } |
| 564 | 564 |
| 565 // static | 565 // static |
| 566 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 566 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
| 567 return render_pass->output_rect.size(); | 567 return render_pass->output_rect.size(); |
| 568 } | 568 } |
| 569 | 569 |
| 570 } // namespace cc | 570 } // namespace cc |
| OLD | NEW |