@@ -56,7 +56,6 @@ const std::vector<Color>& LinearGradientContents::GetColors() const {
56
56
57
57
bool LinearGradientContents::Render (const ContentRenderer& renderer,
58
58
const Entity& entity,
59
- const Surface& surface,
60
59
RenderPass& pass) const {
61
60
using VS = GradientFillPipeline::VertexShader;
62
61
using FS = GradientFillPipeline::FragmentShader;
@@ -75,8 +74,8 @@ bool LinearGradientContents::Render(const ContentRenderer& renderer,
75
74
}
76
75
77
76
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 ();
80
79
81
80
FS::GradientInfo gradient_info;
82
81
gradient_info.start_point = start_point_;
@@ -134,7 +133,6 @@ static VertexBuffer CreateSolidFillVertices(const Path& path,
134
133
135
134
bool SolidColorContents::Render (const ContentRenderer& renderer,
136
135
const Entity& entity,
137
- const Surface& surface,
138
136
RenderPass& pass) const {
139
137
if (color_.IsTransparent ()) {
140
138
return true ;
@@ -150,8 +148,8 @@ bool SolidColorContents::Render(const ContentRenderer& renderer,
150
148
CreateSolidFillVertices (entity.GetPath (), pass.GetTransientsBuffer ()));
151
149
152
150
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 ();
155
153
frame_info.color = color_;
156
154
VS::BindFrameInfo (cmd, pass.GetTransientsBuffer ().EmplaceUniform (frame_info));
157
155
@@ -188,7 +186,6 @@ std::shared_ptr<Texture> TextureContents::GetTexture() const {
188
186
189
187
bool TextureContents::Render (const ContentRenderer& renderer,
190
188
const Entity& entity,
191
- const Surface& surface,
192
189
RenderPass& pass) const {
193
190
if (texture_ == nullptr ) {
194
191
return true ;
@@ -234,8 +231,8 @@ bool TextureContents::Render(const ContentRenderer& renderer,
234
231
auto & host_buffer = pass.GetTransientsBuffer ();
235
232
236
233
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 ();
239
236
240
237
Command cmd;
241
238
cmd.label = " TextureFill" ;
@@ -316,7 +313,6 @@ static VertexBuffer CreateSolidStrokeVertices(const Path& path,
316
313
317
314
bool SolidStrokeContents::Render (const ContentRenderer& renderer,
318
315
const Entity& entity,
319
- const Surface& surface,
320
316
RenderPass& pass) const {
321
317
if (color_.IsTransparent () || stroke_size_ <= 0.0 ) {
322
318
return true ;
@@ -325,8 +321,8 @@ bool SolidStrokeContents::Render(const ContentRenderer& renderer,
325
321
using VS = SolidStrokeVertexShader;
326
322
327
323
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 ();
330
326
331
327
VS::StrokeInfo stroke_info;
332
328
stroke_info.color = color_;
@@ -366,7 +362,6 @@ ClipContents::~ClipContents() = default;
366
362
367
363
bool ClipContents::Render (const ContentRenderer& renderer,
368
364
const Entity& entity,
369
- const Surface& surface,
370
365
RenderPass& pass) const {
371
366
using VS = ClipPipeline::VertexShader;
372
367
@@ -380,7 +375,7 @@ bool ClipContents::Render(const ContentRenderer& renderer,
380
375
VS::FrameInfo info;
381
376
// The color really doesn't matter.
382
377
info.color = Color::SkyBlue ();
383
- info.mvp = Matrix::MakeOrthographic (surface. GetSize ());
378
+ info.mvp = Matrix::MakeOrthographic (pass. GetRenderTargetSize ());
384
379
385
380
VS::BindFrameInfo (cmd, pass.GetTransientsBuffer ().EmplaceUniform (info));
386
381
0 commit comments