diff options
author | robertphillips <robertphillips@google.com> | 2016-04-28 14:32:04 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-28 14:32:04 -0700 |
commit | 175dd9b5e3d7d749738dac743d2ac360b5340187 (patch) | |
tree | ff0ab4b2fb12c714a1723775d031220a68225d6d /tests | |
parent | 801b44c45348144a483793e7b24f4d4092a4f74d (diff) |
Clean up test drawContext usage
The general idea is to provide access to SkGpuDevice's drawContext rather than its GrRenderTarget. That is usually what the testing framework actually wants.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930623003
Review-Url: https://codereview.chromium.org/1930623003
Diffstat (limited to 'tests')
-rw-r--r-- | tests/SurfaceTest.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp index ba66a2b3bb..878adeda3d 100644 --- a/tests/SurfaceTest.cpp +++ b/tests/SurfaceTest.cpp @@ -18,6 +18,7 @@ #if SK_SUPPORT_GPU #include "GrContext.h" +#include "GrDrawContext.h" #include "GrGpu.h" #endif @@ -413,8 +414,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(UniqueImageSnapshot_Gpu, reporter, ctxInfo) { }; auto surfaceBackingStore = [reporter](SkSurface* surface) { - GrRenderTarget* rt = - surface->getCanvas()->internal_private_accessTopLayerRenderTarget(); + GrDrawContext* dc = surface->getCanvas()->internal_private_accessTopLayerDrawContext(); + GrRenderTarget* rt = dc->accessRenderTarget(); if (!rt) { ERRORF(reporter, "Not render target backed."); return static_cast<intptr_t>(0); @@ -861,7 +862,9 @@ void test_surface_clear(skiatest::Reporter* reporter, sk_sp<SkSurface> surface, DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceClear_Gpu, reporter, ctxInfo) { GrContext* context = ctxInfo.fGrContext; std::function<GrSurface*(SkSurface*)> grSurfaceGetters[] = { - [] (SkSurface* s){ return s->getCanvas()->internal_private_accessTopLayerRenderTarget(); }, + [] (SkSurface* s){ + GrDrawContext* dc = s->getCanvas()->internal_private_accessTopLayerDrawContext(); + return dc->accessRenderTarget(); }, [] (SkSurface* s){ SkBaseDevice* d = s->getCanvas()->getDevice_just_for_deprecated_compatibility_testing(); |