| Index: third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp b/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
|
| index 7b9a8bbfa285390fd5a3a586b0ba58cedf01b0ef..f27638f7aef834f7366574b1e21f9b64b8a78930 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
|
| @@ -30,8 +30,9 @@
|
|
|
| #include "platform/graphics/gpu/AcceleratedImageBufferSurface.h"
|
|
|
| -#include "platform/graphics/gpu/SharedGpuContext.h"
|
| #include "platform/graphics/skia/SkiaUtils.h"
|
| +#include "public/platform/Platform.h"
|
| +#include "public/platform/WebGraphicsContext3DProvider.h"
|
| #include "skia/ext/texture_handle.h"
|
| #include "third_party/skia/include/gpu/GrContext.h"
|
| #include "wtf/PtrUtil.h"
|
| @@ -42,11 +43,12 @@
|
| AcceleratedImageBufferSurface::AcceleratedImageBufferSurface(const IntSize& size, OpacityMode opacityMode, sk_sp<SkColorSpace> colorSpace)
|
| : ImageBufferSurface(size, opacityMode, colorSpace)
|
| {
|
| - if (!SharedGpuContext::isValid())
|
| + m_contextProvider = wrapUnique(Platform::current()->createSharedOffscreenGraphicsContext3DProvider());
|
| + if (!m_contextProvider)
|
| return;
|
| - GrContext* grContext = SharedGpuContext::gr();
|
| - m_contextId = SharedGpuContext::contextId();
|
| - CHECK(grContext);
|
| + GrContext* grContext = m_contextProvider->grContext();
|
| + if (!grContext)
|
| + return;
|
|
|
| SkAlphaType alphaType = (Opaque == opacityMode) ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
|
| SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), alphaType);
|
| @@ -56,11 +58,6 @@
|
| if (!m_surface.get())
|
| return;
|
| clear();
|
| -}
|
| -
|
| -bool AcceleratedImageBufferSurface::isValid() const
|
| -{
|
| - return m_surface && SharedGpuContext::isValid() && m_contextId == SharedGpuContext::contextId();
|
| }
|
|
|
| sk_sp<SkImage> AcceleratedImageBufferSurface::newImageSnapshot(AccelerationHint, SnapshotReason)
|
|
|