diff options
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/WebCorePrefixAndroid.h | 1 | ||||
-rw-r--r-- | WebCore/platform/graphics/GraphicsContext.h | 2 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/GraphicsContextAndroid.cpp | 13 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/ImageAndroid.cpp | 4 | ||||
-rw-r--r-- | WebCore/rendering/RenderBoxModelObject.cpp | 4 |
5 files changed, 16 insertions, 8 deletions
diff --git a/WebCore/WebCorePrefixAndroid.h b/WebCore/WebCorePrefixAndroid.h index 901af5f..01e9b28 100644 --- a/WebCore/WebCorePrefixAndroid.h +++ b/WebCore/WebCorePrefixAndroid.h @@ -94,7 +94,6 @@ typedef unsigned char flex_uint8_t; // Converts ListBoxes to dropdown popup lists. #define ANDROID_LISTBOX_USES_MENU_LIST -#define ANDROID_ALLOW_TRANSPARENT_BACKGROUNDS #define ANDROID_HISTORY_CLIENT #define ANDROID_MULTIPLE_WINDOWS #define ANDROID_CSS_TAP_HIGHLIGHT_COLOR diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h index b52344d..233c14c 100644 --- a/WebCore/platform/graphics/GraphicsContext.h +++ b/WebCore/platform/graphics/GraphicsContext.h @@ -204,6 +204,8 @@ namespace WebCore { void setCMYKAFillColor(float c, float m, float y, float k, float a); void setCMYKAStrokeColor(float c, float m, float y, float k, float a); + // initialize a paint for bitmaps + void setupBitmapPaint(SkPaint*); // initialize a paint for filling void setupFillPaint(SkPaint*); // initialize a paint for stroking diff --git a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp index 34b709b..46ac9da 100644 --- a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp @@ -247,6 +247,13 @@ public: paint->setColor(mState->applyAlpha(mState->mFillColor)); } + void setup_paint_bitmap(SkPaint* paint) const { + this->setup_paint_common(paint); + // we only want the global alpha for bitmaps, + // so just give applyAlpha opaque black + paint->setColor(mState->applyAlpha(0xFF000000)); + } + /* sets up the paint for stroking. Returns true if the style is really just a dash of squares (the size of the paint's stroke-width. */ @@ -831,10 +838,14 @@ void GraphicsContext::endTransparencyLayer() /////////////////////////////////////////////////////////////////////////// + void GraphicsContext::setupBitmapPaint(SkPaint* paint) { + m_data->setup_paint_bitmap(paint); + } + void GraphicsContext::setupFillPaint(SkPaint* paint) { m_data->setup_paint_fill(paint); } - + void GraphicsContext::setupStrokePaint(SkPaint* paint) { m_data->setup_paint_stroke(paint, NULL); } diff --git a/WebCore/platform/graphics/android/ImageAndroid.cpp b/WebCore/platform/graphics/android/ImageAndroid.cpp index 16a450f..177aa1f 100644 --- a/WebCore/platform/graphics/android/ImageAndroid.cpp +++ b/WebCore/platform/graphics/android/ImageAndroid.cpp @@ -224,7 +224,7 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, SkCanvas* canvas = ctxt->platformContext()->mCanvas; SkPaint paint; - ctxt->setupFillPaint(&paint); // need global alpha among other things + ctxt->setupBitmapPaint(&paint); // need global alpha among other things paint.setFilterBitmap(true); paint.setXfermodeMode(WebCoreCompositeToSkiaComposite(compositeOp)); fixPaintForBitmapsThatMaySeam(&paint); @@ -292,7 +292,7 @@ void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& srcRect, SkCanvas* canvas = ctxt->platformContext()->mCanvas; SkPaint paint; - ctxt->setupFillPaint(&paint); // need global alpha among other things + ctxt->setupBitmapPaint(&paint); // need global alpha among other things SkShader* shader = SkShader::CreateBitmapShader(bitmap, SkShader::kRepeat_TileMode, diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp index 3a7ff71..2b05170 100644 --- a/WebCore/rendering/RenderBoxModelObject.cpp +++ b/WebCore/rendering/RenderBoxModelObject.cpp @@ -439,12 +439,8 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co context->setCompositeOperation(CompositeCopy); context->fillRect(rect, baseColor); context->restore(); -#ifdef ANDROID_ALLOW_TRANSPARENT_BACKGROUNDS - } -#else } else context->clearRect(rect); -#endif } if (bgColor.isValid() && bgColor.alpha() > 0) |