[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

dpranke at chromium.org dpranke at chromium.org
Wed Dec 22 13:15:46 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 495a2bb5a17805c6d95de920b0f215c2b4c71f32
Author: dpranke at chromium.org <dpranke at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 10 01:29:34 2010 +0000

    2010-09-09  Sheriff Bot  <webkit.review.bot at gmail.com>
    
            Unreviewed, rolling out r67126.
            http://trac.webkit.org/changeset/67126
            https://bugs.webkit.org/show_bug.cgi?id=45510
    
            broke chromium mac compile, it also uses PlatformContextSkia
            (Requested by jamesr on #webkit).
    
            * platform/graphics/chromium/ContentLayerChromium.cpp:
            (WebCore::ContentLayerChromium::updateContents):
            * platform/graphics/chromium/FontLinux.cpp:
            (WebCore::adjustTextRenderMode):
            (WebCore::Font::drawGlyphs):
            (WebCore::Font::drawComplexText):
            * platform/graphics/chromium/LayerRendererChromium.cpp:
            (WebCore::LayerRendererChromium::setRootLayerCanvasSize):
            * platform/graphics/chromium/VideoLayerChromium.cpp:
            (WebCore::VideoLayerChromium::updateContents):
            * platform/graphics/skia/ImageBufferSkia.cpp:
            (WebCore::ImageBuffer::ImageBuffer):
            (WebCore::ImageBuffer::clip):
            * platform/graphics/skia/PlatformContextSkia.cpp:
            (WebCore::PlatformContextSkia::State::State):
            (WebCore::PlatformContextSkia::PlatformContextSkia):
            (WebCore::PlatformContextSkia::save):
            (WebCore::PlatformContextSkia::restore):
            * platform/graphics/skia/PlatformContextSkia.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67141 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 759d64c..a240bef 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,32 @@
+2010-09-09  Sheriff Bot  <webkit.review.bot at gmail.com>
+
+        Unreviewed, rolling out r67126.
+        http://trac.webkit.org/changeset/67126
+        https://bugs.webkit.org/show_bug.cgi?id=45510
+
+        broke chromium mac compile, it also uses PlatformContextSkia
+        (Requested by jamesr on #webkit).
+
+        * platform/graphics/chromium/ContentLayerChromium.cpp:
+        (WebCore::ContentLayerChromium::updateContents):
+        * platform/graphics/chromium/FontLinux.cpp:
+        (WebCore::adjustTextRenderMode):
+        (WebCore::Font::drawGlyphs):
+        (WebCore::Font::drawComplexText):
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::setRootLayerCanvasSize):
+        * platform/graphics/chromium/VideoLayerChromium.cpp:
+        (WebCore::VideoLayerChromium::updateContents):
+        * platform/graphics/skia/ImageBufferSkia.cpp:
+        (WebCore::ImageBuffer::ImageBuffer):
+        (WebCore::ImageBuffer::clip):
+        * platform/graphics/skia/PlatformContextSkia.cpp:
+        (WebCore::PlatformContextSkia::State::State):
+        (WebCore::PlatformContextSkia::PlatformContextSkia):
+        (WebCore::PlatformContextSkia::save):
+        (WebCore::PlatformContextSkia::restore):
+        * platform/graphics/skia/PlatformContextSkia.h:
+
 2010-09-09  Simon Fraser  <simon.fraser at apple.com>
 
         Attempt to fix Qt build.
diff --git a/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp b/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
index 48119bb..5c8b869 100644
--- a/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
@@ -176,9 +176,14 @@ void ContentLayerChromium::updateContents()
     canvas.set(new skia::PlatformCanvas(dirtyRect.width(), dirtyRect.height(), false));
     skiaContext.set(new PlatformContextSkia(canvas.get()));
 
-    // This is needed to get text to show up correctly.
+#if OS(WINDOWS)
+    // This is needed to get text to show up correctly. Without it,
+    // GDI renders with zero alpha and the text becomes invisible.
+    // Unfortunately, setting this to true disables cleartype.
     // FIXME: Does this take us down a very slow text rendering path?
+    // FIXME: why is this is a windows-only call ?
     skiaContext->setDrawingToImageBuffer(true);
+#endif
 
     graphicsContext.set(new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(skiaContext.get())));
 
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index 696cd9c..ab3045e 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -65,13 +65,13 @@ static bool isCanvasMultiLayered(SkCanvas* canvas)
     return !layerIterator.done();
 }
 
-static void adjustTextRenderMode(SkPaint* paint, PlatformContextSkia* skiaContext)
+static void adjustTextRenderMode(SkPaint* paint, bool isCanvasMultiLayered)
 {
     // Our layers only have a single alpha channel. This means that subpixel
     // rendered text cannot be compositied correctly when the layer is
     // collapsed. Therefore, subpixel text is disabled when we are drawing
-    // onto a layer or when the compositor is being used.
-    if (isCanvasMultiLayered(skiaContext->canvas()) || skiaContext->isDrawingToImageBuffer())
+    // onto a layer.
+    if (isCanvasMultiLayered)
         paint->setLCDRenderText(false);
 }
 
@@ -104,13 +104,14 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
 
     SkCanvas* canvas = gc->platformContext()->canvas();
     int textMode = gc->platformContext()->getTextDrawingMode();
+    bool haveMultipleLayers = isCanvasMultiLayered(canvas);
 
     // We draw text up to two times (once for fill, once for stroke).
     if (textMode & cTextFill) {
         SkPaint paint;
         gc->platformContext()->setupPaintForFilling(&paint);
         font->platformData().setupPaint(&paint);
-        adjustTextRenderMode(&paint, gc->platformContext());
+        adjustTextRenderMode(&paint, haveMultipleLayers);
         paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
         paint.setColor(gc->fillColor().rgb());
         canvas->drawPosText(glyphs, numGlyphs << 1, pos, paint);
@@ -123,7 +124,7 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
         SkPaint paint;
         gc->platformContext()->setupPaintForStroking(&paint, 0, 0);
         font->platformData().setupPaint(&paint);
-        adjustTextRenderMode(&paint, gc->platformContext());
+        adjustTextRenderMode(&paint, haveMultipleLayers);
         paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
         paint.setColor(gc->strokeColor().rgb());
 
@@ -645,6 +646,7 @@ void Font::drawComplexText(GraphicsContext* gc, const TextRun& run,
     }
 
     TextRunWalker walker(run, point.x(), this);
+    bool haveMultipleLayers = isCanvasMultiLayered(canvas);
     walker.setWordSpacingAdjustment(wordSpacing());
     walker.setLetterSpacingAdjustment(letterSpacing());
     walker.setPadding(run.padding());
@@ -652,13 +654,13 @@ void Font::drawComplexText(GraphicsContext* gc, const TextRun& run,
     while (walker.nextScriptRun()) {
         if (fill) {
             walker.fontPlatformDataForScriptRun()->setupPaint(&fillPaint);
-            adjustTextRenderMode(&fillPaint, gc->platformContext());
+            adjustTextRenderMode(&fillPaint, haveMultipleLayers);
             canvas->drawPosTextH(walker.glyphs(), walker.length() << 1, walker.xPositions(), point.y(), fillPaint);
         }
 
         if (stroke) {
             walker.fontPlatformDataForScriptRun()->setupPaint(&strokePaint);
-            adjustTextRenderMode(&strokePaint, gc->platformContext());
+            adjustTextRenderMode(&strokePaint, haveMultipleLayers);
             canvas->drawPosTextH(walker.glyphs(), walker.length() << 1, walker.xPositions(), point.y(), strokePaint);
         }
     }
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index 4708310..789298a 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -125,7 +125,10 @@ void LayerRendererChromium::setRootLayerCanvasSize(const IntSize& size)
     // the old ones.
     m_rootLayerCanvas = new skia::PlatformCanvas(size.width(), size.height(), false);
     m_rootLayerSkiaContext = new PlatformContextSkia(m_rootLayerCanvas.get());
+#if OS(WINDOWS)
+    // FIXME: why is this is a windows-only call ?
     m_rootLayerSkiaContext->setDrawingToImageBuffer(true);
+#endif
     m_rootLayerGraphicsContext = new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(m_rootLayerSkiaContext.get()));
 #elif PLATFORM(CG)
     // Release the previous CGBitmapContext before reallocating the backing store as a precaution.
diff --git a/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp b/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
index c0da285..7ff98b9 100644
--- a/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
@@ -96,9 +96,14 @@ void VideoLayerChromium::updateContents()
         m_canvas = new skia::PlatformCanvas(dirtyRect.width(), dirtyRect.height(), true);
         m_skiaContext = new PlatformContextSkia(m_canvas.get());
 
-        // This is needed to get text to show up correctly.
+#if OS(WINDOWS)
+        // This is needed to get text to show up correctly. Without it,
+        // GDI renders with zero alpha and the text becomes invisible.
+        // Unfortunately, setting this to true disables cleartype.
         // FIXME: Does this take us down a very slow text rendering path?
+        // FIXME: Why is this is a windows-only call?
         m_skiaContext->setDrawingToImageBuffer(true);
+#endif
         m_graphicsContext = new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(m_skiaContext.get()));
     }
 
diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index 2be7dc5..9c96673 100644
--- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -69,7 +69,9 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b
 
     m_data.m_platformContext.setCanvas(&m_data.m_canvas);
     m_context.set(new GraphicsContext(&m_data.m_platformContext));
+#if OS(WINDOWS)
     m_context->platformContext()->setDrawingToImageBuffer(true);
+#endif
 
     // Make the background transparent. It would be nice if this wasn't
     // required, but the canvas is currently filled with the magic transparency
@@ -100,7 +102,9 @@ PassRefPtr<Image> ImageBuffer::copyImage() const
 
 void ImageBuffer::clip(GraphicsContext* context, const FloatRect& rect) const
 {
+#if OS(LINUX) || OS(WINDOWS)
     context->platformContext()->beginLayerClippedToImage(rect, this);
+#endif
 }
 
 void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index f0073e2..f0d6548 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -97,10 +97,12 @@ struct PlatformContextSkia::State {
     // color to produce a new output color.
     SkColor applyAlpha(SkColor) const;
 
+#if OS(LINUX) || OS(WINDOWS)
     // If non-empty, the current State is clipped to this image.
     SkBitmap m_imageBufferClip;
     // If m_imageBufferClip is non-empty, this is the region the image is clipped to.
     FloatRect m_clip;
+#endif
 
     // This is a list of clipping paths which are currently active, in the
     // order in which they were pushed.
@@ -156,8 +158,10 @@ PlatformContextSkia::State::State(const State& other)
     , m_lineJoin(other.m_lineJoin)
     , m_dash(other.m_dash)
     , m_textDrawingMode(other.m_textDrawingMode)
+#if OS(LINUX) || OS(WINDOWS)
     , m_imageBufferClip(other.m_imageBufferClip)
     , m_clip(other.m_clip)
+#endif
     , m_antiAliasClipPaths(other.m_antiAliasClipPaths)
     , m_interpolationQuality(other.m_interpolationQuality)
     , m_canvasClipApplied(other.m_canvasClipApplied)
@@ -205,7 +209,9 @@ SkColor PlatformContextSkia::State::applyAlpha(SkColor c) const
 // Danger: canvas can be NULL.
 PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas)
     : m_canvas(canvas)
+#if OS(WINDOWS)
     , m_drawingToImageBuffer(false)
+#endif
     , m_useGPU(false)
     , m_gpuCanvas(0)
     , m_backingStoreState(None)
@@ -225,6 +231,7 @@ void PlatformContextSkia::setCanvas(skia::PlatformCanvas* canvas)
     m_canvas = canvas;
 }
 
+#if OS(WINDOWS)
 void PlatformContextSkia::setDrawingToImageBuffer(bool value)
 {
     m_drawingToImageBuffer = value;
@@ -234,6 +241,7 @@ bool PlatformContextSkia::isDrawingToImageBuffer() const
 {
     return m_drawingToImageBuffer;
 }
+#endif
 
 void PlatformContextSkia::save()
 {
@@ -242,14 +250,17 @@ void PlatformContextSkia::save()
     m_stateStack.append(m_state->cloneInheritedProperties());
     m_state = &m_stateStack.last();
 
+#if OS(LINUX) || OS(WINDOWS)
     // The clip image only needs to be applied once. Reset the image so that we
     // don't attempt to clip multiple times.
     m_state->m_imageBufferClip.reset();
+#endif
 
     // Save our native canvas.
     canvas()->save();
 }
 
+#if OS(LINUX) || OS(WINDOWS)
 void PlatformContextSkia::beginLayerClippedToImage(const FloatRect& rect,
                                                    const ImageBuffer* imageBuffer)
 {
@@ -278,6 +289,7 @@ void PlatformContextSkia::beginLayerClippedToImage(const FloatRect& rect,
         m_state->m_imageBufferClip = *bitmap;
     }
 }
+#endif
 
 void PlatformContextSkia::clipPathAntiAliased(const SkPath& clipPath)
 {
@@ -296,10 +308,12 @@ void PlatformContextSkia::clipPathAntiAliased(const SkPath& clipPath)
 
 void PlatformContextSkia::restore()
 {
+#if OS(LINUX) || OS(WINDOWS)
     if (!m_state->m_imageBufferClip.empty()) {
         applyClipFromImage(m_state->m_clip, m_state->m_imageBufferClip);
         canvas()->restore();
     }
+#endif
 
     if (!m_state->m_antiAliasClipPaths.isEmpty())
         applyAntiAliasedClipPaths(m_state->m_antiAliasClipPaths);
@@ -624,6 +638,7 @@ bool PlatformContextSkia::hasImageResamplingHint() const
     return !m_imageResamplingHintSrcSize.isEmpty() && !m_imageResamplingHintDstSize.isEmpty();
 }
 
+#if OS(LINUX) || OS(WINDOWS)
 void PlatformContextSkia::applyClipFromImage(const FloatRect& rect, const SkBitmap& imageBuffer)
 {
     // NOTE: this assumes the image mask contains opaque black for the portions that are to be shown, as such we
@@ -632,6 +647,7 @@ void PlatformContextSkia::applyClipFromImage(const FloatRect& rect, const SkBitm
     paint.setXfermodeMode(SkXfermode::kDstIn_Mode);
     m_canvas->drawBitmap(imageBuffer, SkFloatToScalar(rect.x()), SkFloatToScalar(rect.y()), &paint);
 }
+#endif
 
 void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths)
 {
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 4ba85d1..e6d5875 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -78,6 +78,7 @@ public:
     // to the constructor.
     void setCanvas(skia::PlatformCanvas*);
 
+#if OS(WINDOWS)
     // If false we're rendering to a GraphicsContext for a web page, if false
     // we're not (as is the case when rendering to a canvas object).
     // If this is true the contents have not been marked up with the magic
@@ -85,6 +86,7 @@ public:
     // correctly updated.
     void setDrawingToImageBuffer(bool);
     bool isDrawingToImageBuffer() const;
+#endif
 
     void save();
     void restore();
@@ -93,7 +95,9 @@ public:
     // |rect|. This layer is implicitly restored when the next restore is
     // invoked.
     // NOTE: |imageBuffer| may be deleted before the |restore| is invoked.
+#if OS(LINUX) || OS(WINDOWS)
     void beginLayerClippedToImage(const FloatRect&, const ImageBuffer*);
+#endif
     void clipPathAntiAliased(const SkPath&);
 
     // Sets up the common flags on a paint for antialiasing, effects, etc.
@@ -193,9 +197,11 @@ public:
     void markDirtyRect(const IntRect& rect);
 
 private:
+#if OS(LINUX) || OS(WINDOWS)
     // Used when restoring and the state has an image clip. Only shows the pixels in
     // m_canvas that are also in imageBuffer.
     void applyClipFromImage(const FloatRect&, const SkBitmap&);
+#endif
     void applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths);
 
     void uploadSoftwareToHardware(CompositeOperator) const;
@@ -221,7 +227,9 @@ private:
     // Values are used in ImageSkia.cpp
     IntSize m_imageResamplingHintSrcSize;
     FloatSize m_imageResamplingHintDstSize;
+#if OS(WINDOWS)
     bool m_drawingToImageBuffer;
+#endif
     bool m_useGPU;
     OwnPtr<GLES2Canvas> m_gpuCanvas;
     mutable enum { None, Software, Mixed, Hardware } m_backingStoreState;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list