Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 5a8f7ec

Browse files
committed
[[ libgraphics ]] Remove unneccessary creation and clearence of SKBitmap
This patch removes code from MCCanvasBaginLayer that was creating a new SkBitmap object and clearing all pixels within. The SkBitmap is not referenced in any further part of the function, so its creation and initilaization can be safely removed.
1 parent ea8f134 commit 5a8f7ec

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

libgraphics/src/context.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -686,18 +686,6 @@ void MCGContextBegin(MCGContextRef self, bool p_need_layer)
686686
SkMatrix t_device_matrix;
687687
t_device_matrix = self -> layer -> canvas -> getTotalMatrix();
688688

689-
// Create a suitable bitmap.
690-
SkBitmap t_new_bitmap;
691-
t_new_bitmap.setInfo(SkImageInfo::MakeN32Premul(t_device_clip.width(), t_device_clip.height()));
692-
if (!t_new_bitmap.tryAllocPixels())
693-
{
694-
self -> is_valid = false;
695-
return;
696-
}
697-
698-
// Clear the pixel buffer.
699-
memset(t_new_bitmap . getPixels(), 0, t_new_bitmap . rowBytes() * t_new_bitmap . height());
700-
701689
// Create a new layer the same size as the device clip
702690
MCGContextLayerRef t_new_layer;
703691
SkIRect t_clip_rect;

0 commit comments

Comments
 (0)