aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrDebugMarkerOp.cpp
blob: 712e625d0b8435dcbf340b83d6dc7eebab00d6e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "GrDebugMarkerOp.h"

#include "GrCaps.h"
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpuCommandBuffer.h"
#include "GrMemoryPool.h"
#include "GrOpFlushState.h"

std::unique_ptr<GrOp> GrDebugMarkerOp::Make(GrContext* context,
                                            GrRenderTargetProxy* proxy,
                                            const SkString& str) {
    GrOpMemoryPool* pool = context->contextPriv().opMemoryPool();

    return pool->allocate<GrDebugMarkerOp>(proxy, str);
}

void GrDebugMarkerOp::onExecute(GrOpFlushState* state) {
    //SkDebugf("%s\n", fStr.c_str());
    if (state->caps().gpuTracingSupport()) {
        state->commandBuffer()->insertEventMarker(fStr.c_str());
    }
}