[EFL] Support screenDepth() functionality.
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2012 17:14:41 +0000 (17:14 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2012 17:14:41 +0000 (17:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89423

Reviewed by Kenneth Rohde Christiansen.

Support screenDepth() based on ecore_x_window_depth_get(). This functionality may be used by
both WebKit1 and WebKit2. So, concrete function is placed into EflScreenUtilities.cpp.

This patch can't support existing test cases. Because, EFL DumpRenderTree works without X11 window
by default.

* platform/efl/EflScreenUtilities.cpp:
(WebCore::getPixelDepth):
(WebCore):
* platform/efl/EflScreenUtilities.h:
(WebCore):
* platform/efl/PlatformScreenEfl.cpp:
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@121163 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/efl/EflScreenUtilities.cpp
Source/WebCore/platform/efl/EflScreenUtilities.h
Source/WebCore/platform/efl/PlatformScreenEfl.cpp

index af7c740..72ec3dc 100644 (file)
@@ -1,3 +1,25 @@
+2012-06-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        [EFL] Support screenDepth() functionality.
+        https://bugs.webkit.org/show_bug.cgi?id=89423
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Support screenDepth() based on ecore_x_window_depth_get(). This functionality may be used by
+        both WebKit1 and WebKit2. So, concrete function is placed into EflScreenUtilities.cpp.
+
+        This patch can't support existing test cases. Because, EFL DumpRenderTree works without X11 window
+        by default.
+
+        * platform/efl/EflScreenUtilities.cpp:
+        (WebCore::getPixelDepth):
+        (WebCore):
+        * platform/efl/EflScreenUtilities.h:
+        (WebCore):
+        * platform/efl/PlatformScreenEfl.cpp:
+        (WebCore::screenDepth):
+        (WebCore::screenDepthPerComponent):
+
 2012-06-25  Shinya Kawanaka  <shinyak@chromium.org>
 
         [Shadow] Executing Italic and InsertUnorderedList in Shadow DOM causes a crash
index e4a7277..e7cd1e4 100644 (file)
@@ -127,6 +127,23 @@ int getDPI()
 #endif
 }
 
+int getPixelDepth(const Evas* evas)
+{
+#ifdef HAVE_ECORE_X
+    Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(evas);
+    // FIXME: ecore_evas_software_x11_window_get() can't get Ecore_X_Window during the layout test.
+    // Because, EFL DumpRenderTree doesn't use X11 window by default.
+    // See also, http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp#L69
+    Ecore_X_Window window = ecore_evas_software_x11_window_get(ecoreEvas);
+    if (!window)
+        return 8;
+
+    return ecore_x_window_depth_get(window);
+#else
+    return 8;
+#endif
+}
+
 bool isUsingEcoreX(const Evas* evas)
 {
 #ifdef HAVE_ECORE_X
index 6ec60ef..ebf52b6 100644 (file)
@@ -27,6 +27,7 @@ namespace WebCore {
 
 void applyFallbackCursor(Ecore_Evas*, const char*);
 int getDPI();
+int getPixelDepth(const Evas*);
 bool isUsingEcoreX(const Evas*);
 
 } // namespace WebCore
index ca655fb..3710624 100644 (file)
@@ -34,6 +34,7 @@
 #include "config.h"
 #include "PlatformScreen.h"
 
+#include "EflScreenUtilities.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
 #include "Widget.h"
@@ -57,14 +58,19 @@ int screenVerticalDPI(Widget* widget)
 
 int screenDepth(Widget* widget)
 {
-    notImplemented();
-    return 8;
+    if (!widget->evas())
+        return 0;
+
+    return getPixelDepth(widget->evas());
 }
 
-int screenDepthPerComponent(Widget*)
+int screenDepthPerComponent(Widget* widget)
 {
-    notImplemented();
-    return 8;
+    if (!widget->evas())
+        return 0;
+
+    // FIXME: How to support this functionality based on EFL library ?
+    return getPixelDepth(widget->evas());
 }
 
 bool screenIsMonochrome(Widget*)