Changeset 66785 in webkit


Ignore:
Timestamp:
Sep 3, 2010 6:24:33 PM (14 years ago)
Author:
jamesr@google.com
Message:

2010-09-03 Kenneth Russell <kbr@google.com>

Reviewed by Darin Fisher.

Add thirdparty directory and incorporate GLU tessellator
https://bugs.webkit.org/show_bug.cgi?id=44707

This directory is intended to contain copies of third-party libraries used
by WebCore, in particular those which may require some modification in
order to incorporate.

No tests at this time; these sources are being added in preparation for
incorporating other code which uses them, at which point the code will be
exercised and testable.

  • thirdparty: Added.
  • thirdparty/README.txt: Added.
  • thirdparty/glu: Added.
  • thirdparty/glu/LICENSE.txt: Added.
  • thirdparty/glu/README.webkit: Added.
  • thirdparty/glu/gluos.h: Added.
  • thirdparty/glu/internal_glu.h: Added.
  • thirdparty/glu/libtess: Added.
  • thirdparty/glu/libtess/GNUmakefile: Added.
  • thirdparty/glu/libtess/Imakefile: Added.
  • thirdparty/glu/libtess/README: Added.
  • thirdparty/glu/libtess/alg-outline: Added.
  • thirdparty/glu/libtess/dict-list.h: Added.
  • thirdparty/glu/libtess/dict.c: Added.
  • thirdparty/glu/libtess/dict.h: Added.
  • thirdparty/glu/libtess/geom.c: Added.
  • thirdparty/glu/libtess/geom.h: Added.
  • thirdparty/glu/libtess/memalloc.c: Added.
  • thirdparty/glu/libtess/memalloc.h: Added.
  • thirdparty/glu/libtess/mesh.c: Added.
  • thirdparty/glu/libtess/mesh.h: Added.
  • thirdparty/glu/libtess/normal.c: Added.
  • thirdparty/glu/libtess/normal.h: Added.
  • thirdparty/glu/libtess/priorityq-heap.c: Added.
  • thirdparty/glu/libtess/priorityq-heap.h: Added.
  • thirdparty/glu/libtess/priorityq-sort.h: Added.
  • thirdparty/glu/libtess/priorityq.c: Added.
  • thirdparty/glu/libtess/priorityq.h: Added.
  • thirdparty/glu/libtess/render.c: Added.
  • thirdparty/glu/libtess/render.h: Added.
  • thirdparty/glu/libtess/sweep.c: Added.
  • thirdparty/glu/libtess/sweep.h: Added.
  • thirdparty/glu/libtess/tess.c: Added.
  • thirdparty/glu/libtess/tess.h: Added.
  • thirdparty/glu/libtess/tessmono.c: Added.
  • thirdparty/glu/libtess/tessmono.h: Added.
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r66784 r66785  
    389389        (WebCore::GraphicsContext3D::ensureContext):
    390390        (WebCore::GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses):
     391
     3922010-09-03  James Robinson  <jamesr@chromium.org>
     393
     394        Reviewed by Darin Fisher.
     395
     396        [chromium] Implement ImageBufferSkia::draw on the GPU when possible
     397        https://bugs.webkit.org/show_bug.cgi?id=45207
     398
     399        When drawing from an ImageBuffer into a GraphicsContext, attempt to do the
     400        draw in hardware when possible.  This is how canvas 2d's drawImage(canvas, ...)
     401        is implemented.  Adds new API to DrawingBuffer to request a texture containing
     402        the DrawingBuffer's current rendering results.
     403
     404        Test: covered fast/canvas/drawImage.html and all other tests that draw from one
     405        2d canvas into another.
     406
     407        * html/canvas/CanvasRenderingContext2D.cpp:
     408        (WebCore::CanvasRenderingContext2D::drawImage):
     409        * platform/graphics/chromium/DrawingBufferChromium.cpp:
     410        (WebCore::DrawingBuffer::getRenderingResultsAsTexture):
     411        * platform/graphics/gpu/DrawingBuffer.h:
     412        * platform/graphics/skia/ImageBufferSkia.cpp:
     413        (WebCore::ImageBuffer::draw):
    391414
    3924152010-09-03  James Robinson  <jamesr@chromium.org>
  • trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r66782 r66785  
    12891289        canvas()->setOriginTainted();
    12901290
     1291#if ENABLE(ACCELERATED_2D_CANVAS)
     1292    // If we're drawing from one accelerated canvas 2d to another, avoid calling sourceCanvas->makeRenderingResultsAvailable()
     1293    // as that will do a readback to software.
     1294    CanvasRenderingContext* sourceContext = sourceCanvas->renderingContext();
     1295    // FIXME: Implement an accelerated path for drawing from a WebGL canvas to a 2d canvas when possible.
     1296    if (!isAccelerated() || !sourceContext || !sourceContext->isAccelerated() || !sourceContext->is2d())
     1297        sourceCanvas->makeRenderingResultsAvailable();
     1298#else
    12911299    sourceCanvas->makeRenderingResultsAvailable();
     1300#endif
    12921301
    12931302    c->drawImageBuffer(buffer, DeviceColorSpace, destRect, sourceRect, state().m_globalComposite);
  • trunk/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp

    r66780 r66785  
    120120}
    121121
     122unsigned DrawingBuffer::getRenderingResultsAsTexture()
     123{
     124    return m_internal->offscreenColorTexture;
    122125}
     126
     127}
  • trunk/WebCore/platform/graphics/gpu/DrawingBuffer.h

    r66746 r66785  
    5959    IntSize size() const { return m_size; }
    6060
     61    unsigned getRenderingResultsAsTexture();
     62
    6163    class WillPublishCallback : public Noncopyable {
    6264    public:
  • trunk/WebCore/platform/graphics/skia/ImageBufferSkia.cpp

    r65921 r66785  
    3737#include "BitmapImage.h"
    3838#include "BitmapImageSingleFrameSkia.h"
     39#include "DrawingBuffer.h"
     40#include "GLES2Canvas.h"
    3941#include "GraphicsContext.h"
    4042#include "ImageData.h"
     43#include "PNGImageEncoder.h"
    4144#include "PlatformContextSkia.h"
    42 #include "PNGImageEncoder.h"
    4345#include "SkColorPriv.h"
    4446#include "SkiaUtils.h"
     
    109111                       CompositeOperator op, bool useLowQualityScale)
    110112{
     113    if (m_data.m_platformContext.useGPU() && context->platformContext()->useGPU()) {
     114        DrawingBuffer* sourceDrawingBuffer = m_data.m_platformContext.gpuCanvas()->drawingBuffer();
     115        unsigned sourceTexture = sourceDrawingBuffer->getRenderingResultsAsTexture();
     116        FloatRect destRectFlipped(destRect);
     117        destRectFlipped.setY(destRect.y() + destRect.height());
     118        destRectFlipped.setHeight(-destRect.height());
     119        context->platformContext()->gpuCanvas()->drawTexturedRect(sourceTexture, m_size, srcRect, destRectFlipped, styleColorSpace, op);
     120        return;
     121    }
     122
    111123    RefPtr<Image> image = BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), context == m_context);
    112124    context->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
Note: See TracChangeset for help on using the changeset viewer.