Changeset 74570 in webkit


Ignore:
Timestamp:
Dec 23, 2010 11:57:15 AM (13 years ago)
Author:
mdelaney@apple.com
Message:

2010-12-22 Matthew Delaney <mdelaney@apple.com>

Reviewed by Simon Fraser.

Add setNeedsStyleRecalc for getting canvas contexts that use IOSurfaces
This patch also changes USE_IOSURFACE to instead follow USE(IOSURFACE)
https://bugs.webkit.org/show_bug.cgi?id=51279

  • html/HTMLCanvasElement.cpp: For IOSurface, use setNeedsStyleRecalc
  • html/canvas/CanvasRenderingContext2D.cpp: Use new flag
  • platform/graphics/ImageBuffer.h: Use new flag
  • platform/graphics/cg/ImageBufferCG.cpp: Use new flag

2010-12-22 Matthew Delaney <mdelaney@apple.com>

Reviewed by Simon Fraser.

Add setNeedsStyleRecalc for getting canvas contexts that use IOSurfaces
https://bugs.webkit.org/show_bug.cgi?id=51279

  • platform/mac-snowleopard/platform/mac/compositing: Added.
  • platform/mac-snowleopard/platform/mac/compositing/canvas: Added.
  • platform/mac-snowleopard/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt: Added.
  • platform/mac/compositing/canvas: Added.
  • platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt: Added.
  • platform/mac/compositing/canvas/accelerated-canvas-compositing.html: Added.
Location:
trunk
Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r74567 r74570  
     12010-12-22  Matthew Delaney  <mdelaney@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Add setNeedsStyleRecalc for getting canvas contexts that use IOSurfaces
     6        https://bugs.webkit.org/show_bug.cgi?id=51279
     7
     8        * platform/mac-snowleopard/platform/mac/compositing: Added.
     9        * platform/mac-snowleopard/platform/mac/compositing/canvas: Added.
     10        * platform/mac-snowleopard/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt: Added.
     11        * platform/mac/compositing/canvas: Added.
     12        * platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt: Added.
     13        * platform/mac/compositing/canvas/accelerated-canvas-compositing.html: Added.
     14
    1152010-12-23  Kenneth Russell  <kbr@google.com>
    216
  • trunk/WebCore/ChangeLog

    r74568 r74570  
     12010-12-22  Matthew Delaney  <mdelaney@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Add setNeedsStyleRecalc for getting canvas contexts that use IOSurfaces
     6        This patch also changes USE_IOSURFACE to instead follow USE(IOSURFACE)
     7        https://bugs.webkit.org/show_bug.cgi?id=51279
     8
     9        * html/HTMLCanvasElement.cpp: For IOSurface, use setNeedsStyleRecalc
     10        * html/canvas/CanvasRenderingContext2D.cpp: Use new flag
     11        * platform/graphics/ImageBuffer.h: Use new flag
     12        * platform/graphics/cg/ImageBufferCG.cpp: Use new flag
     13
    1142010-12-20  Adrienne Walker  <enne@google.com>
    215
  • trunk/WebCore/html/HTMLCanvasElement.cpp

    r73927 r74570  
    158158#endif
    159159            m_context = adoptPtr(new CanvasRenderingContext2D(this, document()->inQuirksMode(), usesDashbardCompatibilityMode));
    160 #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING)
     160#if USE(IOSURFACE_CANVAS_BACKING_STORE) || (ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING))
    161161            if (m_context) {
    162162                // Need to make sure a RenderLayer and compositing layer get created for the Canvas
     
    385385        return;
    386386
    387 #if defined(USE_IOSURFACE)
     387#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    388388    m_imageBuffer = ImageBuffer::create(size, ColorSpaceDeviceRGB, Accelerated);
    389389#else
  • trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r74066 r74570  
    145145bool CanvasRenderingContext2D::isAccelerated() const
    146146{
    147 #if defined(USE_IOSURFACE)
     147#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    148148    return true;
    149149#elif ENABLE(ACCELERATED_2D_CANVAS)
     
    18241824        IntRect maskRect = enclosingIntRect(textRect);
    18251825
    1826 #if defined(USE_IOSURFACE)
     1826#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    18271827        OwnPtr<ImageBuffer> maskImage = ImageBuffer::create(maskRect.size(), ColorSpaceDeviceRGB, Accelerated);
    18281828#else
  • trunk/WebCore/platform/graphics/ImageBuffer.h

    r73949 r74570  
    4141
    4242#if (PLATFORM(MAC) && PLATFORM(CA) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD))
    43 #define USE_IOSURFACE 1
     43#define WTF_USE_IOSURFACE_CANVAS_BACKING_STORE 1
    4444#endif
    4545
  • trunk/WebCore/platform/graphics/cg/ImageBufferCG.cpp

    r74148 r74570  
    4343#include <math.h>
    4444
    45 #if defined(USE_IOSURFACE)
     45#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    4646#include <IOSurface/IOSurface.h>
    4747#endif
     
    5555namespace WebCore {
    5656
    57 #if defined(USE_IOSURFACE)
     57#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    5858static RetainPtr<IOSurfaceRef> createIOSurface(const IntSize& size)
    5959{
     
    101101ImageBufferData::ImageBufferData(const IntSize&)
    102102    : m_data(0)
    103 #if defined(USE_IOSURFACE)
     103#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    104104    , m_surface(0)
    105105#endif
     
    112112    , m_accelerateRendering(renderingMode == Accelerated)
    113113{
    114 #if !defined(USE_IOSURFACE)
     114#if !USE(IOSURFACE_CANVAS_BACKING_STORE)
    115115    ASSERT(renderingMode == Unaccelerated);
    116116#endif
     
    149149        m_data.m_dataProvider.adoptCF(CGDataProviderCreateWithData(0, m_data.m_data, dataSize, releaseImageData));
    150150    } else {
    151 #if defined(USE_IOSURFACE)
     151#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    152152        m_data.m_surface = createIOSurface(size);
    153153        cgContext.adoptCF(wkIOSurfaceContextCreate(m_data.m_surface.get(), size.width(), size.height(), m_data.m_colorSpace));
     
    186186    if (!m_accelerateRendering)
    187187        ctxImage = CGBitmapContextCreateImage(context()->platformContext());
    188 #if defined(USE_IOSURFACE)
     188#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    189189    else
    190190        ctxImage = wkIOSurfaceContextCreateImage(context()->platformContext());
     
    242242    if (!m_accelerateRendering)
    243243        image.adoptCF(cgImage(m_size, m_data));
    244 #if defined(USE_IOSURFACE)
     244#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    245245    else
    246246        image.adoptCF(wkIOSurfaceContextCreateImage(platformContext));
     
    310310        }
    311311    } else {
    312 #if defined(USE_IOSURFACE)
     312#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    313313        IOSurfaceRef surface = imageData.m_surface.get();
    314314        IOSurfaceLock(surface, kIOSurfaceLockReadOnly, 0);
     
    411411        }
    412412    } else {
    413 #if defined(USE_IOSURFACE)
     413#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    414414        IOSurfaceRef surface = imageData.m_surface.get();
    415415        IOSurfaceLock(surface, 0, 0);
     
    497497    if (!m_accelerateRendering)
    498498        image.adoptCF(CGBitmapContextCreateImage(context()->platformContext()));
    499 #if defined(USE_IOSURFACE)
     499#if USE(IOSURFACE_CANVAS_BACKING_STORE)
    500500    else
    501501        image.adoptCF(wkIOSurfaceContextCreateImage(context()->platformContext()));
Note: See TracChangeset for help on using the changeset viewer.