Add additional logging in GrRenderTargetOpList

Add logging for execute and prepare ops in GrRenderTargetOpList.

Bug: skia:
Change-Id: I18ac03676da058ba4af5bd6a0c375b3f17c3c399
Reviewed-on: https://skia-review.googlesource.com/35320
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
This commit is contained in:
Stan Iliev 2017-08-16 13:00:28 -04:00 committed by Skia Commit-Bot
parent cf75b00ff0
commit 2af578d25b

View File

@ -15,6 +15,7 @@
#include "instanced/InstancedRendering.h" #include "instanced/InstancedRendering.h"
#include "ops/GrClearOp.h" #include "ops/GrClearOp.h"
#include "ops/GrCopySurfaceOp.h" #include "ops/GrCopySurfaceOp.h"
#include "SkTraceEvent.h"
using gr_instanced::InstancedRendering; using gr_instanced::InstancedRendering;
@ -63,10 +64,16 @@ void GrRenderTargetOpList::dump() const {
void GrRenderTargetOpList::prepareOps(GrOpFlushState* flushState) { void GrRenderTargetOpList::prepareOps(GrOpFlushState* flushState) {
SkASSERT(fTarget.get()->priv().peekRenderTarget()); SkASSERT(fTarget.get()->priv().peekRenderTarget());
SkASSERT(this->isClosed()); SkASSERT(this->isClosed());
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
TRACE_EVENT0("skia", TRACE_FUNC);
#endif
// Loop over the ops that haven't yet been prepared. // Loop over the ops that haven't yet been prepared.
for (int i = 0; i < fRecordedOps.count(); ++i) { for (int i = 0; i < fRecordedOps.count(); ++i) {
if (fRecordedOps[i].fOp) { if (fRecordedOps[i].fOp) {
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
TRACE_EVENT0("skia", fRecordedOps[i].fOp->name());
#endif
GrOpFlushState::DrawOpArgs opArgs = { GrOpFlushState::DrawOpArgs opArgs = {
fTarget.get()->asRenderTargetProxy(), fTarget.get()->asRenderTargetProxy(),
fRecordedOps[i].fAppliedClip, fRecordedOps[i].fAppliedClip,
@ -129,6 +136,9 @@ bool GrRenderTargetOpList::executeOps(GrOpFlushState* flushState) {
} }
SkASSERT(fTarget.get()->priv().peekRenderTarget()); SkASSERT(fTarget.get()->priv().peekRenderTarget());
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
TRACE_EVENT0("skia", TRACE_FUNC);
#endif
std::unique_ptr<GrGpuCommandBuffer> commandBuffer = create_command_buffer( std::unique_ptr<GrGpuCommandBuffer> commandBuffer = create_command_buffer(
flushState->gpu(), flushState->gpu(),
@ -143,6 +153,9 @@ bool GrRenderTargetOpList::executeOps(GrOpFlushState* flushState) {
if (!fRecordedOps[i].fOp) { if (!fRecordedOps[i].fOp) {
continue; continue;
} }
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
TRACE_EVENT0("skia", fRecordedOps[i].fOp->name());
#endif
if (fRecordedOps[i].fOp->needsCommandBufferIsolation()) { if (fRecordedOps[i].fOp->needsCommandBufferIsolation()) {
// This op is a special snowflake and must occur between command buffers // This op is a special snowflake and must occur between command buffers