Changeset 166566 in webkit
- Timestamp:
- Mar 31, 2014 11:09:55 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166563 r166566 1 2014-03-31 Ryuan Choi <ryuan.choi@samsung.com> 2 3 [EFL][WK2] Extract the control of page background out of color_set 4 https://bugs.webkit.org/show_bug.cgi?id=127539 5 6 Reviewed by Gyuyoung Kim. 7 8 * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp: 9 Added m_viewBackgroundColor to clear when m_setDrawsBackground is false. 10 (WebCore::CoordinatedGraphicsScene::CoordinatedGraphicsScene): 11 (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext): 12 (WebCore::CoordinatedGraphicsScene::paintToGraphicsContext): 13 * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h: 14 (WebCore::CoordinatedGraphicsScene::setViewBackgroundColor): 15 (WebCore::CoordinatedGraphicsScene::viewBackgroundColor): 16 * rendering/RenderLayerBacking.cpp: 17 (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): 18 Added EFL guard not to set opaque as a default for MainFrameRenderViewLayer. 19 * rendering/RenderLayerCompositor.cpp: 20 (WebCore::RenderLayerCompositor::ensureRootLayer): 21 Added EFL guard to apply page scale on RenderView like IOS. 22 1 23 2014-03-31 Byungseon Shin <sun.shin@lge.com> 2 24 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp
r163972 r166566 53 53 , m_rootLayerID(InvalidCoordinatedLayerID) 54 54 , m_backgroundColor(Color::white) 55 , m_viewBackgroundColor(Color::white) 55 56 , m_setDrawsBackground(false) 56 57 { … … 87 88 m_backgroundColor.alpha() * opacity); 88 89 m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), Color(rgba)); 90 } else { 91 GraphicsContext3D* context = static_cast<TextureMapperGL*>(m_textureMapper.get())->graphicsContext3D(); 92 context->clearColor(m_viewBackgroundColor.red() / 255.0f, m_viewBackgroundColor.green() / 255.0f, m_viewBackgroundColor.blue() / 255.0f, m_viewBackgroundColor.alpha() / 255.0f); 93 context->clear(GraphicsContext3D::COLOR_BUFFER_BIT); 89 94 } 90 95 … … 125 130 if (m_setDrawsBackground) 126 131 m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), m_backgroundColor); 132 else 133 m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), m_viewBackgroundColor); 127 134 128 135 layer->paint(); -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h
r163972 r166566 84 84 void setDrawsBackground(bool enable) { m_setDrawsBackground = enable; } 85 85 86 void setViewBackgroundColor(const Color& color) { m_viewBackgroundColor = color; } 87 Color viewBackgroundColor() const { return m_viewBackgroundColor; } 88 86 89 private: 87 90 void setRootLayerID(CoordinatedLayerID); … … 183 186 FloatPoint m_renderedContentsScrollPosition; 184 187 Color m_backgroundColor; 188 Color m_viewBackgroundColor; 185 189 bool m_setDrawsBackground; 186 190 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r166526 r166566 305 305 } 306 306 307 #if !PLATFORM(IOS) && !PLATFORM(EFL) 307 308 if (m_isMainFrameRenderViewLayer) { 308 #if !PLATFORM(IOS)309 309 // Page scale is applied above the RenderView on iOS. 310 310 m_graphicsLayer->setContentsOpaque(true); 311 311 m_graphicsLayer->setAppliesPageScale(); 312 #endif 313 } 312 } 313 #endif 314 314 315 315 #if PLATFORM(COCOA) && USE(CA) -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r166531 r166566 43 43 #include "InspectorInstrumentation.h" 44 44 #include "Logging.h" 45 #include "MainFrame.h" 45 46 #include "NodeList.h" 46 47 #include "Page.h" … … 3086 3087 m_rootContentLayer->setPosition(FloatPoint()); 3087 3088 3088 #if PLATFORM(IOS) 3089 #if PLATFORM(IOS) || PLATFORM(EFL) 3089 3090 // Page scale is applied above this on iOS, so we'll just say that our root layer applies it. 3090 3091 Frame& frame = m_renderView.frameView().frame(); -
trunk/Source/WebKit2/ChangeLog
r166565 r166566 1 2014-03-31 Ryuan Choi <ryuan.choi@samsung.com> 2 3 [EFL][WK2] Extract the control of page background out of color_set 4 https://bugs.webkit.org/show_bug.cgi?id=127539 5 6 Reviewed by Gyuyoung Kim. 7 8 EFL have a way to change the color using evas_object_color_set and we used it to change background. 9 But, We should not use it because the alpha value of color_set is used 10 for the transparancy of object itself including background and contents. 11 12 This patch added ewk_view_bg_color_{get|set} to change the background color. 13 14 * UIProcess/API/C/efl/WKViewEfl.cpp: 15 Extracted controls of page background out of color_set. 16 color_set will be only used for the opacity of whole contents. 17 (WKViewSetBackgroundColor): Added to share page background color. 18 (WKViewGetBackgroundColor): 19 * UIProcess/API/C/efl/WKViewEfl.h: 20 * UIProcess/API/efl/EwkView.cpp: 21 (EwkView::handleEvasObjectColorSet): 22 * UIProcess/API/efl/ewk_view.cpp: 23 Removed ewk_view_draws_page_background_set which just control whether to draw background. 24 ewk_view_bg_color_set will conver it. 25 (ewk_view_bg_color_set): 26 (ewk_view_bg_color_get): 27 * UIProcess/API/efl/ewk_view.h: 28 * UIProcess/API/efl/tests/test_ewk2_view.cpp: Added simple test case. 29 * UIProcess/efl/WebViewEfl.cpp: 30 (WebKit::WebViewEfl::setViewBackgroundColor): 31 (WebKit::WebViewEfl::viewBackgroundColor): 32 * UIProcess/efl/WebViewEfl.h: 33 1 34 2014-03-31 Joonghun Park <jh718.park@samsung.com> 2 35 -
trunk/Source/WebKit2/UIProcess/API/C/efl/WKViewEfl.cpp
r164271 r166566 85 85 static_cast<WebViewEfl*>(toImpl(viewRef))->sendMouseEvent(event); 86 86 } 87 88 void WKViewSetBackgroundColor(WKViewRef viewRef, int red, int green, int blue, int alpha) 89 { 90 static_cast<WebViewEfl*>(toImpl(viewRef))->setViewBackgroundColor(WebCore::Color(red, green, blue, alpha)); 91 } 92 93 void WKViewGetBackgroundColor(WKViewRef viewRef, int* red, int* green, int* blue, int* alpha) 94 { 95 WebCore::Color backgroundColor = static_cast<WebViewEfl*>(toImpl(viewRef))->viewBackgroundColor(); 96 97 if (red) 98 *red = backgroundColor.red(); 99 if (green) 100 *green = backgroundColor.green(); 101 if (blue) 102 *blue = backgroundColor.blue(); 103 if (alpha) 104 *alpha = backgroundColor.alpha(); 105 } -
trunk/Source/WebKit2/UIProcess/API/C/efl/WKViewEfl.h
r164271 r166566 66 66 WK_EXPORT void WKViewSendMouseMoveEvent(WKViewRef, Evas_Event_Mouse_Move*); 67 67 68 WK_EXPORT void WKViewSetBackgroundColor(WKViewRef, int red, int green, int blue, int alpha); 69 WK_EXPORT void WKViewGetBackgroundColor(WKViewRef, int* red, int* green, int* blue, int* alpha); 70 68 71 #ifdef __cplusplus 69 72 } -
trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp
r166159 r166566 1259 1259 ASSERT(smartData); 1260 1260 1261 EwkView* view = toEwkView(smartData);1262 ASSERT(view);1263 1264 alpha = clampTo(alpha, 0, 255);1265 red = clampTo(red, 0, alpha);1266 green = clampTo(green, 0, alpha);1267 blue = clampTo(blue, 0, alpha);1268 1269 1261 evas_object_image_alpha_set(smartData->image, alpha < 255); 1270 WKViewSetDrawsBackground(view->wkView(), red || green || blue);1271 WKViewSetDrawsTransparentBackground(view->wkView(), alpha < 255);1272 1273 1262 parentSmartClass.color_set(evasObject, red, green, blue, alpha); 1274 1263 } -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
r164266 r166566 53 53 #include <WebKit2/WKURL.h> 54 54 #include <WebKit2/WKView.h> 55 #include <WebKit2/WKViewEfl.h> 55 56 #include <wtf/text/CString.h> 56 57 … … 590 591 } 591 592 592 void ewk_view_draws_page_background_set(Evas_Object *ewkView, Eina_Bool enabled)593 {594 EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);595 596 WKViewSetDrawsBackground(impl->wkView(), enabled);597 }598 599 593 /// Creates a type name for Ewk_Page_Contents_Context. 600 594 typedef struct Ewk_Page_Contents_Context Ewk_Page_Contents_Context; … … 722 716 return WKPageUseFixedLayout(WKViewGetPage(impl->wkView())); 723 717 } 718 719 void ewk_view_bg_color_set(Evas_Object* ewkView, int red, int green, int blue, int alpha) 720 { 721 if (EINA_UNLIKELY(alpha < 0 || alpha > 255)) { 722 EINA_LOG_CRIT("Alpha should be between 0 and 255"); 723 return; 724 } 725 726 EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl); 727 728 if (red == 255 && green == 255 && blue == 255 && alpha == 255) 729 WKViewSetDrawsBackground(impl->wkView(), true); 730 else 731 WKViewSetDrawsBackground(impl->wkView(), false); 732 733 WKViewSetBackgroundColor(impl->wkView(), red, green, blue, alpha); 734 } 735 736 void ewk_view_bg_color_get(const Evas_Object* ewkView, int* red, int* green, int* blue, int* alpha) 737 { 738 EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl); 739 740 WKViewGetBackgroundColor(impl->wkView(), red, green, blue, alpha); 741 } -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h
r166399 r166566 840 840 841 841 /** 842 * Sets whether the ewk_view background matches page background color.843 *844 * If enabled sets view background color close to page color on page load.845 * This helps to reduce flicker on page scrolling and repainting in places846 * where page content is not ready for painting.847 * View background color can interfere with semi-transparent pages and is848 * disabled by default.849 *850 * @param o view object to enable/disable background matching851 * @param enabled a state to set852 *853 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure854 */855 EAPI void ewk_view_draws_page_background_set(Evas_Object *o, Eina_Bool enabled);856 857 /**858 842 * Get contents of the current web page. 859 843 * … … 904 888 EAPI Eina_Bool ewk_view_layout_fixed_get(const Evas_Object *o); 905 889 890 /** 891 * Sets the background color and transparency of the view. 892 * 893 * @param o view object to change the background color 894 * @param r red color component 895 * @param g green color component 896 * @param b blue color component 897 * @param a transparency 898 */ 899 EAPI void ewk_view_bg_color_set(Evas_Object *o, int r, int g, int b, int a); 900 901 /** 902 * Gets the background color of the view. 903 * 904 * @param o view object to get the background color 905 * @param r the pointer to store red color component 906 * @param g the pointer to store green color component 907 * @param b the pointer to store blue color component 908 * @param a the pointer to store alpha value 909 */ 910 EAPI void ewk_view_bg_color_get(const Evas_Object *o, int *r, int *g, int *b, int *a); 911 906 912 #ifdef __cplusplus 907 913 } -
trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp
r165598 r166566 1084 1084 EXPECT_TRUE(ewk_view_layout_fixed_get(webView())); 1085 1085 } 1086 1087 TEST_F(EWK2ViewTest, ewk_view_bg_color) 1088 { 1089 const char noBackgroundHTML[] = "<!doctype html><body></body>"; 1090 1091 ewk_view_bg_color_set(webView(), 255, 0, 0, 255); 1092 ewk_view_html_string_load(webView(), noBackgroundHTML, 0, 0); 1093 ASSERT_TRUE(waitUntilLoadFinished()); 1094 1095 int red, green, blue, alpha; 1096 ewk_view_bg_color_get(webView(), &red, &green, &blue, &alpha); 1097 ASSERT_EQ(255, red); 1098 ASSERT_EQ(0, green); 1099 ASSERT_EQ(0, blue); 1100 ASSERT_EQ(255, red); 1101 } -
trunk/Source/WebKit2/UIProcess/efl/WebViewEfl.cpp
r165313 r166566 148 148 } 149 149 150 void WebViewEfl::setViewBackgroundColor(const WebCore::Color& color) 151 { 152 CoordinatedGraphicsScene* scene = coordinatedGraphicsScene(); 153 if (!scene) 154 return; 155 156 scene->setViewBackgroundColor(color); 157 } 158 159 WebCore::Color WebViewEfl::viewBackgroundColor() 160 { 161 CoordinatedGraphicsScene* scene = coordinatedGraphicsScene(); 162 if (!scene) 163 return Color(); 164 165 return scene->viewBackgroundColor(); 166 } 167 150 168 #if ENABLE(FULLSCREEN_API) 151 169 -
trunk/Source/WebKit2/UIProcess/efl/WebViewEfl.h
r165313 r166566 61 61 #endif 62 62 63 void setViewBackgroundColor(const WebCore::Color&); 64 WebCore::Color viewBackgroundColor(); 63 65 private: 64 66 WebViewEfl(WebContext*, WebPageGroup*); -
trunk/Tools/ChangeLog
r166564 r166566 1 2014-03-31 Ryuan Choi <ryuan.choi@samsung.com> 2 3 [EFL][WK2] Extract the control of page background out of color_set 4 https://bugs.webkit.org/show_bug.cgi?id=127539 5 6 Reviewed by Gyuyoung Kim. 7 8 Added an option(C) to change background color. 9 10 * MiniBrowser/efl/main.c: 11 (window_create): 12 (elm_main): 13 1 14 2014-03-31 Ryuan Choi <ryuan.choi@samsung.com> 2 15 -
trunk/Tools/MiniBrowser/efl/main.c
r165610 r166566 48 48 static char *evas_engine_name = NULL; 49 49 static char *user_agent_string = NULL; 50 static char *background_color_string = NULL; 50 51 static Eina_Bool encoding_detector_enabled = EINA_FALSE; 51 52 static Eina_Bool frame_flattening_enabled = EINA_FALSE; … … 160 161 ECORE_GETOPT_STORE_DEF_BOOL 161 162 ('c', "encoding-detector", "Enable/disable encoding detector.", EINA_FALSE), 163 ECORE_GETOPT_STORE_STR 164 ('C', "background-color", "Background color of page. ex) -C=255:255:255:255"), 162 165 ECORE_GETOPT_STORE_DEF_BOOL 163 166 ('f', "flattening", "Enable/disable frame flattening.", EINA_FALSE), … … 1836 1839 } 1837 1840 1841 if (background_color_string) { 1842 int red, green, blue, alpha; 1843 1844 if (sscanf(background_color_string, "%d:%d:%d:%d", &red, &green, &blue, &alpha)) 1845 ewk_view_bg_color_set(window->ewk_view, red, green, blue, alpha); 1846 } 1847 1838 1848 /* Set the zoom level to default */ 1839 1849 window->current_zoom_level = DEFAULT_ZOOM_LEVEL; … … 1940 1950 ECORE_GETOPT_VALUE_BOOL(quitOption), 1941 1951 ECORE_GETOPT_VALUE_BOOL(encoding_detector_enabled), 1952 ECORE_GETOPT_VALUE_STR(background_color_string), 1942 1953 ECORE_GETOPT_VALUE_BOOL(frame_flattening_enabled), 1943 1954 ECORE_GETOPT_VALUE_BOOL(local_storage_enabled),
Note: See TracChangeset
for help on using the changeset viewer.