diff options
author | Robert Phillips <robertphillips@google.com> | 2018-04-05 09:30:38 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-05 14:21:07 +0000 |
commit | 8caf85f9f40f6bad38bf66bd02b87dcebe139a5c (patch) | |
tree | 46a2b1414601ca99f6c60bd3442e8075bc27173f /src/image/SkSurface.cpp | |
parent | 91749c82523c8b0b3f2b6f800d85893ca5386fbd (diff) |
Add GrBackendTexture/RenderTarget accessors to SkSurface
Change-Id: I63477fd4b8d48dc50af72736f0f8df566cd96d4a
Reviewed-on: https://skia-review.googlesource.com/85220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/image/SkSurface.cpp')
-rw-r--r-- | src/image/SkSurface.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp index 9444de7724..41bed215f5 100644 --- a/src/image/SkSurface.cpp +++ b/src/image/SkSurface.cpp @@ -6,11 +6,13 @@ */ #include "SkAtomics.h" -#include "SkSurface_Base.h" -#include "SkImagePriv.h" #include "SkCanvas.h" - #include "SkFontLCDConfig.h" +#include "SkImagePriv.h" +#include "SkSurface_Base.h" + +#include "GrBackendSurface.h" + static SkPixelGeometry compute_default_geometry() { SkFontLCDConfig::LCDOrder order = SkFontLCDConfig::GetSubpixelOrder(); if (SkFontLCDConfig::kNONE_LCDOrder == order) { @@ -70,6 +72,14 @@ SkSurface_Base::~SkSurface_Base() { } } +GrBackendTexture SkSurface_Base::onGetBackendTexture(BackendHandleAccess) { + return GrBackendTexture(); // invalid +} + +GrBackendRenderTarget SkSurface_Base::onGetBackendRenderTarget(BackendHandleAccess) { + return GrBackendRenderTarget(); // invalid +} + void SkSurface_Base::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) { auto image = this->makeImageSnapshot(); if (image) { @@ -216,6 +226,16 @@ bool SkSurface::getRenderTargetHandle(GrBackendObject* obj, BackendHandleAccess return asSB(this)->onGetRenderTargetHandle(obj, access); } +#if GR_TEST_UTILS +GrBackendTexture SkSurface::getBackendTexture(BackendHandleAccess access) { + return asSB(this)->onGetBackendTexture(access); +} + +GrBackendRenderTarget SkSurface::getBackendRenderTarget(BackendHandleAccess access) { + return asSB(this)->onGetBackendRenderTarget(access); +} +#endif + void SkSurface::prepareForExternalIO() { this->flush(); } |