Changeset 132615 in webkit
- Timestamp:
- Oct 26, 2012 4:21:25 AM (11 years ago)
- Location:
- trunk/Source/WebKit/efl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/efl/ChangeLog
r132396 r132615 1 2012-10-26 Hyowon Kim <hw1008.kim@samsung.com> 2 3 [Texmap][EFL] Implementation of AC related functions in ChromeClientEfl and ewkView. 4 https://bugs.webkit.org/show_bug.cgi?id=82315 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 This patch implements accelerated-compositing-related functions 9 to enter accelerated-compositing mode and sync layers 10 in ChromeClientEfl and ewkView. 11 12 * WebCoreSupport/ChromeClientEfl.cpp: 13 (WebCore::ChromeClientEfl::attachRootGraphicsLayer): 14 (WebCore::ChromeClientEfl::setNeedsOneShotDrawingSynchronization): 15 (WebCore::ChromeClientEfl::scheduleCompositingLayerFlush): 16 (WebCore::ChromeClientEfl::allowedCompositingTriggers): 17 * ewk/ewk_view.cpp: 18 (_Ewk_View_Private_Data): 19 (_ewk_view_priv_new): 20 (_ewk_view_priv_del): 21 (_ewk_view_accelerated_compositing_cb): 22 Sync and render layers. 23 (_ewk_view_accelerated_compositing_context_create_if_needed): 24 Create a new AcceleratedCompositingContext. 25 (ewk_view_accelerated_compositing_object_create): 26 Create a new evas_image_object act as render target surface. 27 (ewk_view_accelerated_compositing_context_get): 28 Return the GraphicsContext3D for accelerated compositing. 29 (ewk_view_root_graphics_layer_set): 30 Set the root layer to AcceleratedCompositingContext. 31 (ewk_view_mark_for_sync): 32 Mark the evas_image_object for accelerated compositing as dirty to make it update. 33 * ewk/ewk_view_private.h: 34 (WebCore): 35 1 36 2012-10-24 Brady Eidson <beidson@apple.com> 2 37 -
trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
r131617 r132615 592 592 593 593 #if USE(ACCELERATED_COMPOSITING) 594 void ChromeClientEfl::attachRootGraphicsLayer(Frame*, GraphicsLayer* )595 { 596 notImplemented();594 void ChromeClientEfl::attachRootGraphicsLayer(Frame*, GraphicsLayer* rootLayer) 595 { 596 ewk_view_root_graphics_layer_set(m_view, rootLayer); 597 597 } 598 598 599 599 void ChromeClientEfl::setNeedsOneShotDrawingSynchronization() 600 600 { 601 notImplemented();601 ewk_view_mark_for_sync(m_view); 602 602 } 603 603 604 604 void ChromeClientEfl::scheduleCompositingLayerFlush() 605 605 { 606 notImplemented();606 ewk_view_mark_for_sync(m_view); 607 607 } 608 608 609 609 ChromeClient::CompositingTriggerFlags ChromeClientEfl::allowedCompositingTriggers() const 610 610 { 611 return 0;611 return AllTriggers; 612 612 } 613 613 #endif -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r132193 r132615 95 95 96 96 #if USE(ACCELERATED_COMPOSITING) 97 #include " NotImplemented.h"97 #include "AcceleratedCompositingContextEfl.h" 98 98 #endif 99 99 … … 251 251 Ewk_History* history; 252 252 OwnPtr<PageClientEfl> pageClient; 253 #if USE(ACCELERATED_COMPOSITING) 254 OwnPtr<WebCore::AcceleratedCompositingContext> acceleratedCompositingContext; 255 bool isCompositingActive; 256 RefPtr<Evas_Object> compositingObject; 257 #endif 253 258 #if ENABLE(NETWORK_INFO) 254 259 OwnPtr<WebCore::NetworkInfoClientEfl> networkInfoClient; … … 908 913 priv->contextMenu = 0; 909 914 915 #if USE(ACCELERATED_COMPOSITING) 916 priv->isCompositingActive = false; 917 #endif 918 910 919 return priv; 911 920 } … … 943 952 if (priv->contextMenu) 944 953 ewk_context_menu_free(priv->contextMenu); 954 955 #if USE(ACCELERATED_COMPOSITING) 956 priv->acceleratedCompositingContext = nullptr; 957 #endif 945 958 946 959 delete priv; … … 4495 4508 4496 4509 #if USE(ACCELERATED_COMPOSITING) 4497 bool ewk_view_accelerated_compositing_object_create(Evas_Object*, Evas_Native_Surface*, const WebCore::IntRect& /*rect*/) 4498 { 4499 notImplemented(); 4500 return false; 4501 } 4502 4503 WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object*) 4504 { 4505 notImplemented(); 4506 return 0; 4510 void _ewk_view_accelerated_compositing_cb(void* data, Evas_Object*) 4511 { 4512 Ewk_View_Private_Data* priv = static_cast<Ewk_View_Private_Data*>(data); 4513 4514 if (priv->isCompositingActive) { 4515 priv->acceleratedCompositingContext->syncLayersNow(); 4516 priv->acceleratedCompositingContext->renderLayers(); 4517 } 4518 } 4519 4520 void _ewk_view_accelerated_compositing_context_create_if_needed(Evas_Object* ewkView) 4521 { 4522 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); 4523 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); 4524 4525 if (!priv->acceleratedCompositingContext) 4526 priv->acceleratedCompositingContext = WebCore::AcceleratedCompositingContext::create(priv->page->chrome()); 4527 } 4528 4529 bool ewk_view_accelerated_compositing_object_create(Evas_Object* ewkView, Evas_Native_Surface* nativeSurface, const WebCore::IntRect& rect) 4530 { 4531 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false); 4532 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false); 4533 4534 if (!priv->compositingObject) { 4535 priv->compositingObject = evas_object_image_add(smartData->base.evas); 4536 4537 evas_object_pass_events_set(priv->compositingObject.get(), true); // Just for rendering, ignore events. 4538 evas_object_image_alpha_set(priv->compositingObject.get(), true); 4539 evas_object_image_content_hint_set(priv->compositingObject.get(), EVAS_IMAGE_CONTENT_HINT_DYNAMIC); 4540 4541 // Set the pixel get callback. 4542 evas_object_image_pixels_get_callback_set(priv->compositingObject.get(), _ewk_view_accelerated_compositing_cb, priv); 4543 4544 evas_object_smart_member_add(priv->compositingObject.get(), ewkView); 4545 } 4546 4547 evas_object_image_size_set(priv->compositingObject.get(), rect.width(), rect.height()); 4548 evas_object_image_fill_set(priv->compositingObject.get(), 0, 0, rect.width(), rect.height()); 4549 4550 evas_object_move(priv->compositingObject.get(), rect.x(), rect.y()); 4551 evas_object_resize(priv->compositingObject.get(), rect.width(), rect.height()); 4552 evas_object_hide(priv->compositingObject.get()); 4553 4554 // Set up the native surface info to use the context and surface created in GC3DPrivate. 4555 evas_object_image_native_surface_set(priv->compositingObject.get(), nativeSurface); 4556 return true; 4557 } 4558 4559 WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object* ewkView) 4560 { 4561 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0); 4562 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0); 4563 4564 _ewk_view_accelerated_compositing_context_create_if_needed(ewkView); 4565 return priv->acceleratedCompositingContext->context(); 4566 } 4567 4568 void ewk_view_root_graphics_layer_set(Evas_Object* ewkView, WebCore::GraphicsLayer* rootLayer) 4569 { 4570 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); 4571 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); 4572 4573 bool active = !!rootLayer; 4574 if (priv->isCompositingActive == active) 4575 return; 4576 4577 priv->isCompositingActive = active; 4578 4579 if (priv->isCompositingActive) { 4580 _ewk_view_accelerated_compositing_context_create_if_needed(ewkView); 4581 evas_object_show(priv->compositingObject.get()); 4582 } else 4583 evas_object_hide(priv->compositingObject.get()); 4584 4585 priv->acceleratedCompositingContext->attachRootGraphicsLayer(rootLayer); 4586 } 4587 4588 void ewk_view_mark_for_sync(Evas_Object* ewkView) 4589 { 4590 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); 4591 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); 4592 4593 // Mark the image as "dirty" meaning it needs an update next time evas renders. 4594 // It will call the pixel get callback then. 4595 evas_object_image_pixels_dirty_set(priv->compositingObject.get(), true); 4507 4596 } 4508 4597 #endif -
trunk/Source/WebKit/efl/ewk/ewk_view_private.h
r129594 r132615 36 36 37 37 class Cursor; 38 #if USE(ACCELERATED_COMPOSITING) 39 class GraphicsContext3D; 40 class GraphicsLayer; 41 #endif 38 42 class PopupMenuClient; 39 43 } … … 155 159 bool ewk_view_accelerated_compositing_object_create(Evas_Object* ewkView, Evas_Native_Surface* nativeSurface, const WebCore::IntRect& rect); 156 160 WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object* ewkView); 161 void ewk_view_root_graphics_layer_set(Evas_Object* ewkView, WebCore::GraphicsLayer* rootLayer); 162 void ewk_view_mark_for_sync(Evas_Object* ewkView); 157 163 #endif 158 164
Note: See TracChangeset
for help on using the changeset viewer.