1 /* 2 * Copyright 2018 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #include "GrDebugMarkerOp.h" 9 10 #include "GrCaps.h" 11 #include "GrGpuCommandBuffer.h" 12 #include "GrMemoryPool.h" 13 #include "GrOpFlushState.h" 14 #include "GrRecordingContext.h" 15 #include "GrRecordingContextPriv.h" 16 Make(GrRecordingContext * context,GrRenderTargetProxy * proxy,const SkString & str)17std::unique_ptr<GrOp> GrDebugMarkerOp::Make(GrRecordingContext* context, 18 GrRenderTargetProxy* proxy, 19 const SkString& str) { 20 GrOpMemoryPool* pool = context->priv().opMemoryPool(); 21 22 return pool->allocate<GrDebugMarkerOp>(proxy, str); 23 } 24 onExecute(GrOpFlushState * state,const SkRect & chainBounds)25void GrDebugMarkerOp::onExecute(GrOpFlushState* state, const SkRect& chainBounds) { 26 //SkDebugf("%s\n", fStr.c_str()); 27 if (state->caps().gpuTracingSupport()) { 28 state->commandBuffer()->insertEventMarker(fStr.c_str()); 29 } 30 } 31