Changeset 138987 in webkit


Ignore:
Timestamp:
Jan 7, 2013 2:05:33 PM (11 years ago)
Author:
alokp@chromium.org
Message:

[chromium] Fix PlatformContextSkia::setDrawingToImageBuffer abuse
https://bugs.webkit.org/show_bug.cgi?id=104956

Reviewed by James Robinson.

Replaced PlatformContextSkia::SetDrawingToImageBuffer with GraphicsContext::setShouldSmoothFonts.

Source/WebCore:

No new tests needed. No change in functionality.

  • platform/graphics/chromium/CompositorHUDFontAtlas.cpp:

(WebCore::CompositorHUDFontAtlas::generateFontAtlas):

  • platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp:

(WebCore::OpaqueRectTrackingContentLayerDelegate::paintContents):

  • platform/graphics/skia/ImageBufferSkia.cpp:

(WebCore::ImageBuffer::ImageBuffer):

  • platform/graphics/skia/PlatformContextSkia.cpp:

(WebCore::PlatformContextSkia::couldUseLCDRenderedText):
(WebCore):

Source/WebKit/chromium:

  • src/NonCompositedContentHost.cpp:

(WebKit::NonCompositedContentHost::paintContents):
(WebKit):
(WebKit::NonCompositedContentHost::setShowDebugBorders):

  • src/PageWidgetDelegate.cpp:

(WebKit::PageWidgetDelegate::paint):

  • src/WebFontImpl.cpp:

(WebKit::WebFontImpl::drawText):

Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r138986 r138987  
     12013-01-07  Alok Priyadarshi  <alokp@chromium.org>
     2
     3        [chromium] Fix PlatformContextSkia::setDrawingToImageBuffer abuse
     4        https://bugs.webkit.org/show_bug.cgi?id=104956
     5
     6        Reviewed by James Robinson.
     7
     8        Replaced PlatformContextSkia::SetDrawingToImageBuffer with GraphicsContext::setShouldSmoothFonts.
     9
     10        No new tests needed. No change in functionality.
     11
     12        * platform/graphics/chromium/CompositorHUDFontAtlas.cpp:
     13        (WebCore::CompositorHUDFontAtlas::generateFontAtlas):
     14        * platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp:
     15        (WebCore::OpaqueRectTrackingContentLayerDelegate::paintContents):
     16        * platform/graphics/skia/ImageBufferSkia.cpp:
     17        (WebCore::ImageBuffer::ImageBuffer):
     18        * platform/graphics/skia/PlatformContextSkia.cpp:
     19        (WebCore::PlatformContextSkia::couldUseLCDRenderedText):
     20        (WebCore):
     21
    1222013-01-07  Enrica Casucci  <enrica@apple.com>
    223
  • trunk/Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp

    r125961 r138987  
    6161
    6262    PlatformContextSkia platformContext(canvas.get());
    63     platformContext.setDrawingToImageBuffer(true);
    6463    GraphicsContext atlasContext(&platformContext);
     64    atlasContext.setShouldSmoothFonts(false);
    6565
    6666    // Clear the entire texture atlas to transparent before drawing fonts.
  • trunk/Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp

    r133499 r138987  
    5858#endif
    5959    platformContext.setTrackOpaqueRegion(!m_opaque);
    60     // FIXME: Rename PlatformContextSkia::setDrawingToImageBuffer to setCanPaintLCDText.
    61     // I also suspect that a function on PlatformContextSkia is not really needed.
    62     // GraphicsContext::setAllowsFontSmoothing can be used for this purpose.
    63     platformContext.setDrawingToImageBuffer(!(canPaintLCDText && m_opaque));
    6460    GraphicsContext context(&platformContext);
     61    context.setShouldSmoothFonts(canPaintLCDText && m_opaque);
    6562
    6663    // Record transform prior to painting, as all opaque tracking will be
  • trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp

    r137397 r138987  
    139139    m_data.m_platformContext.setCanvas(m_data.m_canvas.get());
    140140    m_context = adoptPtr(new GraphicsContext(&m_data.m_platformContext));
    141     m_context->platformContext()->setDrawingToImageBuffer(true);
     141    m_context->setShouldSmoothFonts(false);
    142142    m_context->scale(FloatSize(m_resolutionScale, m_resolutionScale));
    143143
     
    169169    m_data.m_platformContext.setCanvas(m_data.m_canvas.get());
    170170    m_context = adoptPtr(new GraphicsContext(&m_data.m_platformContext));
    171     m_context->platformContext()->setDrawingToImageBuffer(true);
     171    m_context->setShouldSmoothFonts(false);
    172172    m_context->scale(FloatSize(m_resolutionScale, m_resolutionScale));
    173173
  • trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp

    r136755 r138987  
    630630        return false;
    631631
    632     // If this text is not in an image buffer and so won't be externally
    633     // composited, then subpixel antialiasing is fine.
    634     return !isDrawingToImageBuffer();
     632    return m_gc->shouldSmoothFonts();
    635633}
    636634
  • trunk/Source/WebKit/chromium/ChangeLog

    r138983 r138987  
     12013-01-07  Alok Priyadarshi  <alokp@chromium.org>
     2
     3        [chromium] Fix PlatformContextSkia::setDrawingToImageBuffer abuse
     4        https://bugs.webkit.org/show_bug.cgi?id=104956
     5
     6        Reviewed by James Robinson.
     7
     8        Replaced PlatformContextSkia::SetDrawingToImageBuffer with GraphicsContext::setShouldSmoothFonts.
     9
     10        * src/NonCompositedContentHost.cpp:
     11        (WebKit::NonCompositedContentHost::paintContents):
     12        (WebKit):
     13        (WebKit::NonCompositedContentHost::setShowDebugBorders):
     14        * src/PageWidgetDelegate.cpp:
     15        (WebKit::PageWidgetDelegate::paint):
     16        * src/WebFontImpl.cpp:
     17        (WebKit::WebFontImpl::drawText):
     18
    1192013-01-07  Mike West  <mkwst@chromium.org>
    220
  • trunk/Source/WebKit/chromium/src/NonCompositedContentHost.cpp

    r133517 r138987  
    173173void NonCompositedContentHost::paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext& context, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect)
    174174{
    175     // FIXME: Remove LCD text setting after it is implemented in chromium.
    176     // On non-android platforms, we want to render text with subpixel antialiasing on the root layer
    177     // so long as the root is opaque. On android all text is grayscale.
    178 #if !OS(ANDROID)
    179     if (m_graphicsLayer->contentsOpaque())
    180         context.platformContext()->setDrawingToImageBuffer(false);
    181 #endif
    182175    context.translate(-m_layerAdjust);
    183176    WebCore::IntRect adjustedClipRect = clipRect;
  • trunk/Source/WebKit/chromium/src/PageWidgetDelegate.cpp

    r135459 r138987  
    8888    GraphicsContextBuilder builder(canvas);
    8989    GraphicsContext& gc = builder.context();
    90     gc.platformContext()->setDrawingToImageBuffer(background == Opaque ? false : true);
     90    gc.setShouldSmoothFonts(background == Opaque);
    9191    if (applyDeviceScale) {
    9292        gc.applyDeviceScaleFactor(page->deviceScaleFactor());
  • trunk/Source/WebKit/chromium/src/WebFontImpl.cpp

    r130448 r138987  
    9999    GraphicsContext& gc = builder.context();
    100100
    101     gc.platformContext()->setDrawingToImageBuffer(!canvasIsOpaque);
    102 
    103101    gc.save();
     102    gc.setShouldSmoothFonts(canvasIsOpaque);
    104103    gc.setFillColor(color, ColorSpaceDeviceRGB);
    105104    gc.clip(WebCore::FloatRect(clip));
Note: See TracChangeset for help on using the changeset viewer.