GrDebugMarkerOp.cpp 989 B

123456789101112131415161718192021222324252627282930
  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. #include "src/gpu/ops/GrDebugMarkerOp.h"
  8. #include "include/private/GrRecordingContext.h"
  9. #include "src/gpu/GrCaps.h"
  10. #include "src/gpu/GrGpuCommandBuffer.h"
  11. #include "src/gpu/GrMemoryPool.h"
  12. #include "src/gpu/GrOpFlushState.h"
  13. #include "src/gpu/GrRecordingContextPriv.h"
  14. std::unique_ptr<GrOp> GrDebugMarkerOp::Make(GrRecordingContext* context,
  15. GrRenderTargetProxy* proxy,
  16. const SkString& str) {
  17. GrOpMemoryPool* pool = context->priv().opMemoryPool();
  18. return pool->allocate<GrDebugMarkerOp>(proxy, str);
  19. }
  20. void GrDebugMarkerOp::onExecute(GrOpFlushState* state, const SkRect& chainBounds) {
  21. //SkDebugf("%s\n", fStr.c_str());
  22. if (state->caps().gpuTracingSupport()) {
  23. state->commandBuffer()->insertEventMarker(fStr.c_str());
  24. }
  25. }