summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/agg/fx_agg_driver.cpp5
-rw-r--r--core/fxge/ge/cfx_cliprgn.cpp8
2 files changed, 3 insertions, 10 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index cf0fd90917..9db10ac3c6 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -528,10 +528,7 @@ void CFX_AggDeviceDriver::SetClipMask(agg::rasterizer_scanline_aa& rasterizer) {
rasterizer.max_x() + 1, rasterizer.max_y() + 1);
path_rect.Intersect(m_pClipRgn->GetBox());
CFX_DIBitmapRef mask;
- CFX_DIBitmap* pThisLayer = mask.New();
- if (!pThisLayer) {
- return;
- }
+ CFX_DIBitmap* pThisLayer = mask.Emplace();
pThisLayer->Create(path_rect.Width(), path_rect.Height(), FXDIB_8bppMask);
pThisLayer->Clear(0);
agg::rendering_buffer raw_buf(pThisLayer->GetBuffer(), pThisLayer->GetWidth(),
diff --git a/core/fxge/ge/cfx_cliprgn.cpp b/core/fxge/ge/cfx_cliprgn.cpp
index 41975e4b84..ba2605aeca 100644
--- a/core/fxge/ge/cfx_cliprgn.cpp
+++ b/core/fxge/ge/cfx_cliprgn.cpp
@@ -49,9 +49,7 @@ void CFX_ClipRgn::IntersectMaskRect(FX_RECT rect,
m_Mask = Mask;
return;
}
- CFX_DIBitmap* new_dib = m_Mask.New();
- if (!new_dib)
- return;
+ CFX_DIBitmap* new_dib = m_Mask.Emplace();
new_dib->Create(m_Box.Width(), m_Box.Height(), FXDIB_8bppMask);
for (int row = m_Box.top; row < m_Box.bottom; row++) {
uint8_t* dest_scan =
@@ -82,9 +80,7 @@ void CFX_ClipRgn::IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask) {
return;
}
CFX_DIBitmapRef new_mask;
- CFX_DIBitmap* new_dib = new_mask.New();
- if (!new_dib)
- return;
+ CFX_DIBitmap* new_dib = new_mask.Emplace();
new_dib->Create(new_box.Width(), new_box.Height(), FXDIB_8bppMask);
const CFX_DIBitmap* old_dib = m_Mask.GetObject();
for (int row = new_box.top; row < new_box.bottom; row++) {