Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: xfa/fwl/cfwl_widgetmgr.cpp

Issue 2571913002: Avoid the ptr.reset(new XXX()) anti-pattern (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fwl/cfwl_datetimepicker.cpp ('k') | xfa/fwl/theme/cfwl_checkboxtp.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/cfwl_widgetmgr.h" 7 #include "xfa/fwl/cfwl_widgetmgr.h"
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 556 }
557 557
558 CFX_Graphics* CFWL_WidgetMgr::DrawWidgetBefore(CFWL_Widget* pWidget, 558 CFX_Graphics* CFWL_WidgetMgr::DrawWidgetBefore(CFWL_Widget* pWidget,
559 CFX_Graphics* pGraphics, 559 CFX_Graphics* pGraphics,
560 const CFX_Matrix* pMatrix) { 560 const CFX_Matrix* pMatrix) {
561 if (!FWL_UseOffscreen(pWidget)) 561 if (!FWL_UseOffscreen(pWidget))
562 return pGraphics; 562 return pGraphics;
563 563
564 Item* pItem = GetWidgetMgrItem(pWidget); 564 Item* pItem = GetWidgetMgrItem(pWidget);
565 if (!pItem->pOffscreen) { 565 if (!pItem->pOffscreen) {
566 pItem->pOffscreen.reset(new CFX_Graphics); 566 pItem->pOffscreen = pdfium::MakeUnique<CFX_Graphics>();
567 CFX_RectF rect = pWidget->GetWidgetRect(); 567 CFX_RectF rect = pWidget->GetWidgetRect();
568 pItem->pOffscreen->Create((int32_t)rect.width, (int32_t)rect.height, 568 pItem->pOffscreen->Create((int32_t)rect.width, (int32_t)rect.height,
569 FXDIB_Argb); 569 FXDIB_Argb);
570 } 570 }
571 CFX_RectF rect; 571 CFX_RectF rect;
572 pGraphics->GetClipRect(rect); 572 pGraphics->GetClipRect(rect);
573 pItem->pOffscreen->SetClipRect(rect); 573 pItem->pOffscreen->SetClipRect(rect);
574 return pItem->pOffscreen.get(); 574 return pItem->pOffscreen.get();
575 } 575 }
576 576
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 pWidget(widget), 719 pWidget(widget),
720 iRedrawCounter(0) 720 iRedrawCounter(0)
721 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) 721 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_)
722 , 722 ,
723 bOutsideChanged(false) 723 bOutsideChanged(false)
724 #endif 724 #endif
725 { 725 {
726 } 726 }
727 727
728 CFWL_WidgetMgr::Item::~Item() {} 728 CFWL_WidgetMgr::Item::~Item() {}
OLDNEW
« no previous file with comments | « xfa/fwl/cfwl_datetimepicker.cpp ('k') | xfa/fwl/theme/cfwl_checkboxtp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698