Changeset 104568 in webkit
- Timestamp:
- Jan 10, 2012, 7:17:50 AM (14 years ago)
- Location:
- trunk/Source/WebKit/efl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/efl/ChangeLog
r104562 r104568 1 2012-01-10 Tomasz Morawski <t.morawski@samsung.com> 2 3 [EFL] Added smart pointers to Ewk_View_Paint_Context class and done minor refactoring. 4 https://bugs.webkit.org/show_bug.cgi?id=75837 5 6 Reviewed by Ryosuke Niwa. 7 8 Changed graphicContext raw pointer to OwnPtr smart pointer. 9 Renamed cr to cairo and made it a RefPtr. 10 11 * ewk/ewk_view.cpp: 12 (ewk_view_paint_context_new): Adjust to auto pointers use. 13 (ewk_view_paint_context_free): Removed explicit raw pointers delete. 14 Adjust to auto pointers use: 15 (ewk_view_paint_context_save): 16 (ewk_view_paint_context_restore): 17 (ewk_view_paint_context_clip): 18 (ewk_view_paint_context_paint): 19 (ewk_view_paint_context_paint_contents): 20 1 21 2012-01-09 Raphael Kubo da Costa <kubo@profusion.mobi> 2 22 -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r104282 r104568 2563 2563 */ 2564 2564 struct _Ewk_View_Paint_Context { 2565 WebCore::GraphicsContext* graphicContext;2566 2565 WebCore::FrameView* view; 2567 cairo_t* cr; 2566 OwnPtr<WebCore::GraphicsContext> graphicContext; 2567 RefPtr<cairo_t> cairo; 2568 2568 }; 2569 2569 2570 Ewk_View_Paint_Context* ewk_view_paint_context_new(Ewk_View_Private_Data* priv, cairo_t* c r)2570 Ewk_View_Paint_Context* ewk_view_paint_context_new(Ewk_View_Private_Data* priv, cairo_t* cairo) 2571 2571 { 2572 2572 EINA_SAFETY_ON_NULL_RETURN_VAL(priv, 0); 2573 EINA_SAFETY_ON_NULL_RETURN_VAL(c r, 0);2573 EINA_SAFETY_ON_NULL_RETURN_VAL(cairo, 0); 2574 2574 EINA_SAFETY_ON_NULL_RETURN_VAL(priv->mainFrame, 0); 2575 WebCore::FrameView* view = priv->mainFrame->view(); 2576 EINA_SAFETY_ON_NULL_RETURN_VAL(view, 0); 2577 Ewk_View_Paint_Context* context = static_cast<Ewk_View_Paint_Context*>(malloc(sizeof(*context))); 2578 EINA_SAFETY_ON_NULL_RETURN_VAL(context, 0); 2579 2580 context->graphicContext = new WebCore::GraphicsContext(cr); 2581 if (!context->graphicContext) { 2582 free(context); 2583 return 0; 2584 } 2585 context->view = view; 2586 context->cr = cairo_reference(cr); 2575 EINA_SAFETY_ON_NULL_RETURN_VAL(priv->mainFrame->view(), 0); 2576 2577 Ewk_View_Paint_Context* context = new Ewk_View_Paint_Context; 2578 context->view = priv->mainFrame->view(); 2579 context->graphicContext = adoptPtr(new WebCore::GraphicsContext(cairo)); 2580 context->cairo = adoptRef(cairo_reference(cairo)); 2581 2587 2582 return context; 2588 2583 } … … 2591 2586 { 2592 2587 EINA_SAFETY_ON_NULL_RETURN(context); 2593 delete context->graphicContext; 2594 cairo_destroy(context->cr); 2595 free(context); 2588 2589 delete context; 2596 2590 } 2597 2591 … … 2599 2593 { 2600 2594 EINA_SAFETY_ON_NULL_RETURN(context); 2601 cairo_save(context->cr); 2595 2596 cairo_save(context->cairo.get()); 2602 2597 context->graphicContext->save(); 2603 2598 } … … 2606 2601 { 2607 2602 EINA_SAFETY_ON_NULL_RETURN(context); 2603 2608 2604 context->graphicContext->restore(); 2609 cairo_restore(context->c r);2605 cairo_restore(context->cairo.get()); 2610 2606 } 2611 2607 … … 2614 2610 EINA_SAFETY_ON_NULL_RETURN(context); 2615 2611 EINA_SAFETY_ON_NULL_RETURN(area); 2612 2616 2613 context->graphicContext->clip(WebCore::IntRect(area->x, area->y, area->w, area->h)); 2617 2614 } … … 2626 2623 if (context->view->isTransparent()) 2627 2624 context->graphicContext->clearRect(rect); 2628 context->view->paint(context->graphicContext , rect);2625 context->view->paint(context->graphicContext.get(), rect); 2629 2626 } 2630 2627 … … 2639 2636 context->graphicContext->clearRect(rect); 2640 2637 2641 context->view->paintContents(context->graphicContext , rect);2638 context->view->paintContents(context->graphicContext.get(), rect); 2642 2639 } 2643 2640
Note:
See TracChangeset
for help on using the changeset viewer.