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

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

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Calculate damage of |force_render_surface|. 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
OLDNEW
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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 ScopedResource* texture = render_pass_textures_[render_pass->id].get(); 617 ScopedResource* texture = render_pass_textures_[render_pass->id].get();
618 DCHECK(texture); 618 DCHECK(texture);
619 619
620 gfx::Size size = RenderPassTextureSize(render_pass); 620 gfx::Size size = RenderPassTextureSize(render_pass);
621 size.Enlarge(enlarge_pass_texture_amount_.width(), 621 size.Enlarge(enlarge_pass_texture_amount_.width(),
622 enlarge_pass_texture_amount_.height()); 622 enlarge_pass_texture_amount_.height());
623 if (!texture->id()) { 623 if (!texture->id()) {
624 texture->Allocate( 624 texture->Allocate(
625 size, ResourceProvider::TEXTURE_HINT_IMMUTABLE_FRAMEBUFFER, 625 size, ResourceProvider::TEXTURE_HINT_IMMUTABLE_FRAMEBUFFER,
626 BackbufferFormat(), current_frame()->current_render_pass->color_space); 626 BackbufferFormat(), current_frame()->current_render_pass->color_space);
627 } else {
628 if (render_pass->force_render_surface &&
jbauman 2017/06/07 22:05:34 Could we instead set the damage rectangle to empty
wutao 2017/06/09 02:31:32 Sounds good and thanks for your sample cl. The da
629 !(render_pass->has_property_change_on_contributing_render_surface ||
630 render_pass->has_damage_on_surface_quad)) {
jbauman 2017/05/30 22:04:07 What exactly does it mean if there's damage on a s
wutao 2017/05/30 23:12:52 The surface_quad damage is accumulated during surf
631 return false;
632 }
627 } 633 }
628 DCHECK(texture->id()); 634 DCHECK(texture->id());
629 635
630 if (BindFramebufferToTexture(texture)) { 636 if (BindFramebufferToTexture(texture)) {
631 InitializeViewport(current_frame(), render_pass->output_rect, 637 InitializeViewport(current_frame(), render_pass->output_rect,
632 gfx::Rect(render_pass->output_rect.size()), 638 gfx::Rect(render_pass->output_rect.size()),
633 texture->size()); 639 texture->size());
634 return true; 640 return true;
635 } 641 }
636 642
637 return false; 643 return false;
638 } 644 }
639 645
640 bool DirectRenderer::HasAllocatedResourcesForTesting(int render_pass_id) const { 646 bool DirectRenderer::HasAllocatedResourcesForTesting(int render_pass_id) const {
641 auto iter = render_pass_textures_.find(render_pass_id); 647 auto iter = render_pass_textures_.find(render_pass_id);
642 return iter != render_pass_textures_.end() && iter->second->id(); 648 return iter != render_pass_textures_.end() && iter->second->id();
643 } 649 }
644 650
645 // static 651 // static
646 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { 652 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) {
647 return render_pass->output_rect.size(); 653 return render_pass->output_rect.size();
648 } 654 }
649 655
650 void DirectRenderer::SetCurrentFrameForTesting(const DrawingFrame& frame) { 656 void DirectRenderer::SetCurrentFrameForTesting(const DrawingFrame& frame) {
651 current_frame_valid_ = true; 657 current_frame_valid_ = true;
652 current_frame_ = frame; 658 current_frame_ = frame;
653 } 659 }
654 660
655 } // namespace cc 661 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698