@@ -56,7 +56,6 @@ const std::vector<Color>& LinearGradientContents::GetColors() const {
5656
5757bool LinearGradientContents::Render (const ContentRenderer& renderer,
5858 const Entity& entity,
59- const Surface& surface,
6059 RenderPass& pass) const {
6160 using VS = GradientFillPipeline::VertexShader;
6261 using FS = GradientFillPipeline::FragmentShader;
@@ -75,8 +74,8 @@ bool LinearGradientContents::Render(const ContentRenderer& renderer,
7574 }
7675
7776 VS::FrameInfo frame_info;
78- frame_info.mvp =
79- Matrix::MakeOrthographic (surface. GetSize ()) * entity.GetTransformation ();
77+ frame_info.mvp = Matrix::MakeOrthographic (pass. GetRenderTargetSize ()) *
78+ entity.GetTransformation ();
8079
8180 FS::GradientInfo gradient_info;
8281 gradient_info.start_point = start_point_;
@@ -134,7 +133,6 @@ static VertexBuffer CreateSolidFillVertices(const Path& path,
134133
135134bool SolidColorContents::Render (const ContentRenderer& renderer,
136135 const Entity& entity,
137- const Surface& surface,
138136 RenderPass& pass) const {
139137 if (color_.IsTransparent ()) {
140138 return true ;
@@ -150,8 +148,8 @@ bool SolidColorContents::Render(const ContentRenderer& renderer,
150148 CreateSolidFillVertices (entity.GetPath (), pass.GetTransientsBuffer ()));
151149
152150 VS::FrameInfo frame_info;
153- frame_info.mvp =
154- Matrix::MakeOrthographic (surface. GetSize ()) * entity.GetTransformation ();
151+ frame_info.mvp = Matrix::MakeOrthographic (pass. GetRenderTargetSize ()) *
152+ entity.GetTransformation ();
155153 frame_info.color = color_;
156154 VS::BindFrameInfo (cmd, pass.GetTransientsBuffer ().EmplaceUniform (frame_info));
157155
@@ -188,7 +186,6 @@ std::shared_ptr<Texture> TextureContents::GetTexture() const {
188186
189187bool TextureContents::Render (const ContentRenderer& renderer,
190188 const Entity& entity,
191- const Surface& surface,
192189 RenderPass& pass) const {
193190 if (texture_ == nullptr ) {
194191 return true ;
@@ -234,8 +231,8 @@ bool TextureContents::Render(const ContentRenderer& renderer,
234231 auto & host_buffer = pass.GetTransientsBuffer ();
235232
236233 VS::FrameInfo frame_info;
237- frame_info.mvp =
238- Matrix::MakeOrthographic (surface. GetSize ()) * entity.GetTransformation ();
234+ frame_info.mvp = Matrix::MakeOrthographic (pass. GetRenderTargetSize ()) *
235+ entity.GetTransformation ();
239236
240237 Command cmd;
241238 cmd.label = " TextureFill" ;
@@ -316,7 +313,6 @@ static VertexBuffer CreateSolidStrokeVertices(const Path& path,
316313
317314bool SolidStrokeContents::Render (const ContentRenderer& renderer,
318315 const Entity& entity,
319- const Surface& surface,
320316 RenderPass& pass) const {
321317 if (color_.IsTransparent () || stroke_size_ <= 0.0 ) {
322318 return true ;
@@ -325,8 +321,8 @@ bool SolidStrokeContents::Render(const ContentRenderer& renderer,
325321 using VS = SolidStrokeVertexShader;
326322
327323 VS::FrameInfo frame_info;
328- frame_info.mvp =
329- Matrix::MakeOrthographic (surface. GetSize ()) * entity.GetTransformation ();
324+ frame_info.mvp = Matrix::MakeOrthographic (pass. GetRenderTargetSize ()) *
325+ entity.GetTransformation ();
330326
331327 VS::StrokeInfo stroke_info;
332328 stroke_info.color = color_;
@@ -366,7 +362,6 @@ ClipContents::~ClipContents() = default;
366362
367363bool ClipContents::Render (const ContentRenderer& renderer,
368364 const Entity& entity,
369- const Surface& surface,
370365 RenderPass& pass) const {
371366 using VS = ClipPipeline::VertexShader;
372367
@@ -380,7 +375,7 @@ bool ClipContents::Render(const ContentRenderer& renderer,
380375 VS::FrameInfo info;
381376 // The color really doesn't matter.
382377 info.color = Color::SkyBlue ();
383- info.mvp = Matrix::MakeOrthographic (surface. GetSize ());
378+ info.mvp = Matrix::MakeOrthographic (pass. GetRenderTargetSize ());
384379
385380 VS::BindFrameInfo (cmd, pass.GetTransientsBuffer ().EmplaceUniform (info));
386381
0 commit comments