@@ -115,6 +115,10 @@ bool SolidColorContents::Render(const ContentRenderer& renderer,
115115 const Entity& entity,
116116 const Surface& surface,
117117 RenderPass& pass) const {
118+ if (color_.IsTransparent ()) {
119+ return true ;
120+ }
121+
118122 using VS = SolidFillPipeline::VertexShader;
119123
120124 Command cmd;
@@ -165,18 +169,6 @@ std::unique_ptr<SolidColorContents> SolidColorContents::Make(Color color) {
165169 return contents;
166170}
167171
168- /* ******************************************************************************
169- ******* SolidStrokeContents
170- ******************************************************************************/
171-
172- void SolidStrokeContents::SetColor (Color color) {
173- color_ = color;
174- }
175-
176- const Color& SolidStrokeContents::GetColor () const {
177- return color_;
178- }
179-
180172/* ******************************************************************************
181173 ******* TextureContents
182174 ******************************************************************************/
@@ -267,4 +259,39 @@ const IRect& TextureContents::GetSourceRect() const {
267259 return source_rect_;
268260}
269261
262+ /* ******************************************************************************
263+ ******* SolidStrokeContents
264+ ******************************************************************************/
265+
266+ SolidStrokeContents::SolidStrokeContents () = default ;
267+
268+ SolidStrokeContents::~SolidStrokeContents () = default ;
269+
270+ void SolidStrokeContents::SetColor (Color color) {
271+ color_ = color;
272+ }
273+
274+ const Color& SolidStrokeContents::GetColor () const {
275+ return color_;
276+ }
277+
278+ bool SolidStrokeContents::Render (const ContentRenderer& renderer,
279+ const Entity& entity,
280+ const Surface& surface,
281+ RenderPass& pass) const {
282+ if (color_.IsTransparent () || stroke_size_ <= 0.0 ) {
283+ return true ;
284+ }
285+
286+ return false ;
287+ }
288+
289+ void SolidStrokeContents::SetStrokeSize (Scalar size) {
290+ stroke_size_ = size;
291+ }
292+
293+ Scalar SolidStrokeContents::GetStrokeSize () const {
294+ return stroke_size_;
295+ }
296+
270297} // namespace impeller
0 commit comments