summaryrefslogtreecommitdiffstats
path: root/WebCore/platform
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform')
-rw-r--r--WebCore/platform/android/RenderThemeAndroid.cpp20
-rw-r--r--WebCore/platform/graphics/android/GraphicsContextAndroid.cpp13
-rw-r--r--WebCore/platform/graphics/android/PlatformGraphicsContext.h7
3 files changed, 30 insertions, 10 deletions
diff --git a/WebCore/platform/android/RenderThemeAndroid.cpp b/WebCore/platform/android/RenderThemeAndroid.cpp
index 944504e..113fa63 100644
--- a/WebCore/platform/android/RenderThemeAndroid.cpp
+++ b/WebCore/platform/android/RenderThemeAndroid.cpp
@@ -44,6 +44,7 @@
#include "RenderSkinRadio.h"
#include "SkCanvas.h"
#include "UserAgentStyleSheets.h"
+#include "WebCoreFrameBridge.h"
namespace WebCore {
@@ -67,6 +68,13 @@ static SkCanvas* getCanvasFromInfo(const PaintInfo& info)
return info.context->platformContext()->mCanvas;
}
+static android::WebFrame* getWebFrame(const Node* node)
+{
+ if (!node)
+ return 0;
+ return android::WebFrame::getWebFrame(node->document()->frame());
+}
+
RenderTheme* theme()
{
DEFINE_STATIC_LOCAL(RenderThemeAndroid, androidTheme, ());
@@ -223,9 +231,15 @@ bool RenderThemeAndroid::paintButton(RenderObject* obj, const PaintInfo& info, c
// If it is a disabled button, simply paint it to the master picture.
Node* node = obj->node();
Element* formControlElement = static_cast<Element*>(node);
- if (formControlElement && !formControlElement->isEnabledFormControl())
- RenderSkinButton::Draw(getCanvasFromInfo(info), rect, RenderSkinAndroid::kDisabled);
- else
+ if (formControlElement && !formControlElement->isEnabledFormControl()) {
+ android::WebFrame* webFrame = getWebFrame(node);
+ if (webFrame) {
+ const RenderSkinAndroid* skins = webFrame->renderSkins();
+ if (skins)
+ skins->renderSkinButton()->draw(getCanvasFromInfo(info), rect,
+ RenderSkinAndroid::kDisabled);
+ }
+ } else
// Store all the important information in the platform context.
info.context->platformContext()->storeButtonInfo(node, rect);
diff --git a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
index f9df8cc..ef0cc25 100644
--- a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
+++ b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
@@ -70,10 +70,16 @@ template <typename T> T* deepCopyPtr(const T* src)
// Is Color premultiplied or not? If it is, then I can't blindly pass it to paint.setColor()
struct ShadowRec {
- SkScalar blur; // >0 means valid shadow
+ SkScalar blur;
SkScalar dx;
SkScalar dy;
- SkColor color;
+ SkColor color; // alpha>0 means valid shadow
+ ShadowRec(SkScalar b = 0,
+ SkScalar x = 0,
+ SkScalar y = 0,
+ SkColor c = 0) // by default, alpha=0, so no shadow
+ : blur(b), dx(x), dy(y), color(c)
+ {};
};
class GraphicsContextPlatformPrivate {
@@ -110,7 +116,6 @@ public:
, strokeColor(SK_ColorBLACK)
, useAA(true)
{
- shadow.blur = 0;
}
State(const State& other)
@@ -252,7 +257,7 @@ public:
paint->setAntiAlias(m_state->useAA);
paint->setDither(true);
paint->setXfermodeMode(m_state->mode);
- if (m_state->shadow.blur > 0) {
+ if (SkColorGetA(m_state->shadow.color) > 0) {
SkDrawLooper* looper = new SkBlurDrawLooper(m_state->shadow.blur,
m_state->shadow.dx,
m_state->shadow.dy,
diff --git a/WebCore/platform/graphics/android/PlatformGraphicsContext.h b/WebCore/platform/graphics/android/PlatformGraphicsContext.h
index 8d0df36..0ce86d2 100644
--- a/WebCore/platform/graphics/android/PlatformGraphicsContext.h
+++ b/WebCore/platform/graphics/android/PlatformGraphicsContext.h
@@ -106,7 +106,8 @@ public:
// corresponds to the focused node passed in. If its state has changed,
// re-record to the subpicture, so the master picture will reflect the
// change.
- void updateFocusState(WebCore::RenderSkinAndroid::State state)
+ void updateFocusState(WebCore::RenderSkinAndroid::State state,
+ const WebCore::RenderSkinButton* buttonSkin)
{
if (state == m_state)
return;
@@ -117,8 +118,8 @@ public:
state == WebCore::RenderSkinAndroid::kFocused)
return;
m_state = state;
- SkCanvas* canvas = m_picture->beginRecording(m_rect.width(), m_rect.height());
- WebCore::RenderSkinButton::Draw(canvas, m_rect, state);
+ SkCanvas* canvas = m_picture->beginRecording(m_rect.right(), m_rect.bottom());
+ buttonSkin->draw(canvas, m_rect, state);
m_picture->endRecording();
}
private: