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

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

Issue 2843723003: Make exo::Surface set device_scale_factor. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 cc::CompositorFrame frame; 840 cc::CompositorFrame frame;
841 // If we commit while we don't have an active BeginFrame, we acknowledge a 841 // If we commit while we don't have an active BeginFrame, we acknowledge a
842 // manual one. 842 // manual one.
843 if (current_begin_frame_ack_.sequence_number == 843 if (current_begin_frame_ack_.sequence_number ==
844 cc::BeginFrameArgs::kInvalidFrameNumber) { 844 cc::BeginFrameArgs::kInvalidFrameNumber) {
845 current_begin_frame_ack_ = cc::BeginFrameAck::CreateManualAckWithDamage(); 845 current_begin_frame_ack_ = cc::BeginFrameAck::CreateManualAckWithDamage();
846 } else { 846 } else {
847 current_begin_frame_ack_.has_damage = true; 847 current_begin_frame_ack_.has_damage = true;
848 } 848 }
849 frame.metadata.begin_frame_ack = current_begin_frame_ack_; 849 frame.metadata.begin_frame_ack = current_begin_frame_ack_;
850 frame.metadata.device_scale_factor = state_.buffer_scale;
reveman 2017/04/25 20:56:17 I don't think this is correct as setting the viewp
kylechar 2017/04/26 13:56:52 Okay, that mostly makes sense to me and I misunder
reveman 2017/04/26 17:48:42 We always send the primary scale right now. Real m
kylechar 2017/04/27 18:24:56 Done.
850 851
851 if (current_resource_.id) { 852 if (current_resource_.id) {
852 // Texture quad is only needed if buffer is not fully transparent. 853 // Texture quad is only needed if buffer is not fully transparent.
853 if (state_.alpha) { 854 if (state_.alpha) {
854 cc::TextureDrawQuad* texture_quad = 855 cc::TextureDrawQuad* texture_quad =
855 render_pass->CreateAndAppendDrawQuad<cc::TextureDrawQuad>(); 856 render_pass->CreateAndAppendDrawQuad<cc::TextureDrawQuad>();
856 float vertex_opacity[4] = {1.0, 1.0, 1.0, 1.0}; 857 float vertex_opacity[4] = {1.0, 1.0, 1.0, 1.0};
857 gfx::Rect opaque_rect; 858 gfx::Rect opaque_rect;
858 if (!current_resource_has_alpha_ || 859 if (!current_resource_has_alpha_ ||
859 state_.blend_mode == SkBlendMode::kSrc || 860 state_.blend_mode == SkBlendMode::kSrc ||
(...skipping 16 matching lines...) Expand all
876 render_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>(); 877 render_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>();
877 solid_quad->SetNew(quad_state, quad_rect, quad_rect, SK_ColorBLACK, false); 878 solid_quad->SetNew(quad_state, quad_rect, quad_rect, SK_ColorBLACK, false);
878 } 879 }
879 880
880 frame.render_pass_list.push_back(std::move(render_pass)); 881 frame.render_pass_list.push_back(std::move(render_pass));
881 compositor_frame_sink_holder_->GetCompositorFrameSink() 882 compositor_frame_sink_holder_->GetCompositorFrameSink()
882 ->SubmitCompositorFrame(local_surface_id_, std::move(frame)); 883 ->SubmitCompositorFrame(local_surface_id_, std::move(frame));
883 } 884 }
884 885
885 } // namespace exo 886 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698