diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp index eac5e4a..8e1937f 100644 --- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp +++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp @@ -68,18 +68,6 @@ namespace WebCore { -#if ENABLE(SKIA_GPU) -GrContext* GetGlobalGrContext() -{ - static GrContext* gGR; - if (!gGR) { - gGR = GrContext::CreateGLShaderContext(); - gGR->setTextureCacheLimits(512, 50 * 1024 * 1024); - } - return gGR; -} -#endif - extern bool isPathSkiaSafe(const SkMatrix& transform, const SkPath& path); // State ----------------------------------------------------------------------- @@ -241,8 +229,14 @@ PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas) PlatformContextSkia::~PlatformContextSkia() { #if ENABLE(ACCELERATED_2D_CANVAS) - if (m_gpuCanvas) + if (m_gpuCanvas) { +#if ENABLE(SKIA_GPU) + // make sure everything related to this platform context has been flushed + if (!m_useGPU) + m_gpuCanvas->context()->grContext()->flush(0); +#endif m_gpuCanvas->drawingBuffer()->setWillPublishCallback(0); + } #endif } @@ -697,8 +691,7 @@ void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths) bool PlatformContextSkia::canAccelerate() const { - return !m_state->m_fillShader // Can't accelerate with a fill gradient or pattern. - && !m_state->m_looper; // Can't accelerate with a shadow. + return !m_state->m_fillShader; // Can't accelerate with a fill gradient or pattern. } bool PlatformContextSkia::canvasClipApplied() const @@ -741,8 +734,10 @@ void PlatformContextSkia::setSharedGraphicsContext3D(SharedGraphicsContext3D* co context->makeContextCurrent(); m_gpuCanvas->bindFramebuffer(); - GrContext* gr = GetGlobalGrContext(); + GrContext* gr = context->grContext(); gr->resetContext(); + drawingBuffer->setGrContext(gr); + SkDeviceFactory* factory = new SkGpuDeviceFactory(gr, SkGpuDevice::Current3DApiRenderTarget()); SkDevice* device = factory->newDevice(m_canvas, SkBitmap::kARGB_8888_Config, drawingBuffer->size().width(), drawingBuffer->size().height(), false, false); m_canvas->setDevice(device)->unref(); |