blob: 712e625d0b8435dcbf340b83d6dc7eebab00d6e3 [file] [log] [blame]
Robert Phillips88a32ef2018-06-07 11:05:56 -04001/*
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 "GrContext.h"
12#include "GrContextPriv.h"
13#include "GrGpuCommandBuffer.h"
Robert Phillips7c525e62018-06-12 10:11:12 -040014#include "GrMemoryPool.h"
Robert Phillips88a32ef2018-06-07 11:05:56 -040015#include "GrOpFlushState.h"
16
17std::unique_ptr<GrOp> GrDebugMarkerOp::Make(GrContext* context,
18 GrRenderTargetProxy* proxy,
19 const SkString& str) {
Robert Phillipsc994a932018-06-19 13:09:54 -040020 GrOpMemoryPool* pool = context->contextPriv().opMemoryPool();
21
22 return pool->allocate<GrDebugMarkerOp>(proxy, str);
Robert Phillips88a32ef2018-06-07 11:05:56 -040023}
24
25void GrDebugMarkerOp::onExecute(GrOpFlushState* state) {
26 //SkDebugf("%s\n", fStr.c_str());
27 if (state->caps().gpuTracingSupport()) {
28 state->commandBuffer()->insertEventMarker(fStr.c_str());
29 }
30}