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

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

Issue 2875753002: Implement aura::WindowPortMus::CreateCompositorFrameSink() (Closed)
Patch Set: Address review issues 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
« no previous file with comments | « no previous file | services/ui/ws/window_server.cc » ('j') | services/ui/ws/window_server.cc » ('J')
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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 DLOG_IF(WARNING, !gfx::IsExpressibleAsInt(state_.crop.width()) || 765 DLOG_IF(WARNING, !gfx::IsExpressibleAsInt(state_.crop.width()) ||
766 !gfx::IsExpressibleAsInt(state_.crop.height())) 766 !gfx::IsExpressibleAsInt(state_.crop.height()))
767 << "Crop rectangle size (" << state_.crop.size().ToString() 767 << "Crop rectangle size (" << state_.crop.size().ToString()
768 << ") most be expressible using integers when viewport is not set"; 768 << ") most be expressible using integers when viewport is not set";
769 layer_size = gfx::ToCeiledSize(state_.crop.size()); 769 layer_size = gfx::ToCeiledSize(state_.crop.size());
770 } else { 770 } else {
771 layer_size = gfx::ToCeiledSize(scaled_buffer_size); 771 layer_size = gfx::ToCeiledSize(scaled_buffer_size);
772 } 772 }
773 773
774 content_size_ = layer_size; 774 content_size_ = layer_size;
775 window_->SetBounds(gfx::Rect(window_->bounds().origin(), content_size_));
775 // TODO(jbauman): Figure out how this interacts with the pixel size of 776 // TODO(jbauman): Figure out how this interacts with the pixel size of
776 // CopyOutputRequests on the layer. 777 // CopyOutputRequests on the layer.
777 gfx::Size contents_surface_size = layer_size; 778 gfx::Size contents_surface_size = layer_size;
778 779
779 gfx::PointF uv_top_left(0.f, 0.f); 780 gfx::PointF uv_top_left(0.f, 0.f);
780 gfx::PointF uv_bottom_right(1.f, 1.f); 781 gfx::PointF uv_bottom_right(1.f, 1.f);
781 if (!state_.crop.IsEmpty()) { 782 if (!state_.crop.IsEmpty()) {
782 uv_top_left = state_.crop.origin(); 783 uv_top_left = state_.crop.origin();
783 784
784 uv_top_left.Scale(1.f / scaled_buffer_size.width(), 785 uv_top_left.Scale(1.f / scaled_buffer_size.width(),
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 render_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>(); 851 render_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>();
851 solid_quad->SetNew(quad_state, quad_rect, quad_rect, SK_ColorBLACK, false); 852 solid_quad->SetNew(quad_state, quad_rect, quad_rect, SK_ColorBLACK, false);
852 } 853 }
853 854
854 frame.render_pass_list.push_back(std::move(render_pass)); 855 frame.render_pass_list.push_back(std::move(render_pass));
855 compositor_frame_sink_holder_->GetCompositorFrameSink() 856 compositor_frame_sink_holder_->GetCompositorFrameSink()
856 ->SubmitCompositorFrame(std::move(frame)); 857 ->SubmitCompositorFrame(std::move(frame));
857 } 858 }
858 859
859 } // namespace exo 860 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | services/ui/ws/window_server.cc » ('j') | services/ui/ws/window_server.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698