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

Side by Side Diff: components/exo/surface.cc

Issue 2755463002: [cc] Fix CompositorFrameSinkSupport BeginFrameAck interface. (Closed)
Patch Set: sync Created 3 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/surface.h" 5 #include "components/exo/surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 gfx::Transform()); 831 gfx::Transform());
832 832
833 gfx::Rect quad_rect = output_rect; 833 gfx::Rect quad_rect = output_rect;
834 cc::SharedQuadState* quad_state = 834 cc::SharedQuadState* quad_state =
835 render_pass->CreateAndAppendSharedQuadState(); 835 render_pass->CreateAndAppendSharedQuadState();
836 quad_state->quad_layer_bounds = contents_surface_size; 836 quad_state->quad_layer_bounds = contents_surface_size;
837 quad_state->visible_quad_layer_rect = quad_rect; 837 quad_state->visible_quad_layer_rect = quad_rect;
838 quad_state->opacity = state_.alpha; 838 quad_state->opacity = state_.alpha;
839 839
840 cc::CompositorFrame frame; 840 cc::CompositorFrame frame;
841 current_begin_frame_ack_.has_damage = true; 841 // If we commit while we don't have an active BeginFrame, we acknowledge a
842 // manual one.
843 if (current_begin_frame_ack_.sequence_number ==
844 cc::BeginFrameArgs::kInvalidFrameNumber) {
845 current_begin_frame_ack_ = cc::BeginFrameAck::CreateManualAckWithDamage();
846 } else {
847 current_begin_frame_ack_.has_damage = true;
848 }
842 frame.metadata.begin_frame_ack = current_begin_frame_ack_; 849 frame.metadata.begin_frame_ack = current_begin_frame_ack_;
843 850
844 if (current_resource_.id) { 851 if (current_resource_.id) {
845 // Texture quad is only needed if buffer is not fully transparent. 852 // Texture quad is only needed if buffer is not fully transparent.
846 if (state_.alpha) { 853 if (state_.alpha) {
847 cc::TextureDrawQuad* texture_quad = 854 cc::TextureDrawQuad* texture_quad =
848 render_pass->CreateAndAppendDrawQuad<cc::TextureDrawQuad>(); 855 render_pass->CreateAndAppendDrawQuad<cc::TextureDrawQuad>();
849 float vertex_opacity[4] = {1.0, 1.0, 1.0, 1.0}; 856 float vertex_opacity[4] = {1.0, 1.0, 1.0, 1.0};
850 gfx::Rect opaque_rect; 857 gfx::Rect opaque_rect;
851 if (!current_resource_has_alpha_ || 858 if (!current_resource_has_alpha_ ||
(...skipping 17 matching lines...) Expand all
869 render_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>(); 876 render_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>();
870 solid_quad->SetNew(quad_state, quad_rect, quad_rect, SK_ColorBLACK, false); 877 solid_quad->SetNew(quad_state, quad_rect, quad_rect, SK_ColorBLACK, false);
871 } 878 }
872 879
873 frame.render_pass_list.push_back(std::move(render_pass)); 880 frame.render_pass_list.push_back(std::move(render_pass));
874 compositor_frame_sink_holder_->GetCompositorFrameSink() 881 compositor_frame_sink_holder_->GetCompositorFrameSink()
875 ->SubmitCompositorFrame(local_surface_id_, std::move(frame)); 882 ->SubmitCompositorFrame(local_surface_id_, std::move(frame));
876 } 883 }
877 884
878 } // namespace exo 885 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698