From bbcb38df4f7477aa0a38da00a0757586a0125954 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Thu, 19 Jun 2014 10:19:29 -0700 Subject: Allow gpu debug markers to be placed by using a GrContext If a marker is placed using a GrContext, it will add a marker to both the drawBuffer and gpu targets of that context. BUG=skia: R=bsalomon@google.com Author: egdaniel@google.com Review URL: https://codereview.chromium.org/340893002 --- src/gpu/GrContext.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gpu/GrContext.cpp') diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index e823a986cf..6c90c178d3 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -28,6 +28,7 @@ #include "GrStencilBuffer.h" #include "GrStrokeInfo.h" #include "GrTextStrike.h" +#include "GrTraceMarker.h" #include "GrTracing.h" #include "SkDashPathPriv.h" #include "SkGr.h" @@ -1904,6 +1905,20 @@ GrCacheable* GrContext::findAndRefCachedResource(const GrResourceKey& resourceKe return resource; } +void GrContext::addGpuTraceMarker(const GrGpuTraceMarker* marker) { + fGpu->addGpuTraceMarker(marker); + if (NULL != fDrawBuffer) { + fDrawBuffer->addGpuTraceMarker(marker); + } +} + +void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { + fGpu->removeGpuTraceMarker(marker); + if (NULL != fDrawBuffer) { + fDrawBuffer->removeGpuTraceMarker(marker); + } +} + /////////////////////////////////////////////////////////////////////////////// #if GR_CACHE_STATS void GrContext::printCacheStats() const { -- cgit v1.2.3