1 /*
2 * Copyright 2015 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 "GrDrawOp.h"
9
10 #include "GrRenderTarget.h"
11
DumpPipelineInfo(const GrPipeline & pipeline)12 SkString GrDrawOp::DumpPipelineInfo(const GrPipeline& pipeline) {
13 SkString string;
14 string.appendf("RT: %d\n", pipeline.getRenderTarget()->uniqueID().asUInt());
15 string.append("ColorStages:\n");
16 for (int i = 0; i < pipeline.numColorFragmentProcessors(); i++) {
17 string.appendf("\t\t%s\n\t\t%s\n",
18 pipeline.getColorFragmentProcessor(i).name(),
19 pipeline.getColorFragmentProcessor(i).dumpInfo().c_str());
20 }
21 string.append("CoverageStages:\n");
22 for (int i = 0; i < pipeline.numCoverageFragmentProcessors(); i++) {
23 string.appendf("\t\t%s\n\t\t%s\n",
24 pipeline.getCoverageFragmentProcessor(i).name(),
25 pipeline.getCoverageFragmentProcessor(i).dumpInfo().c_str());
26 }
27 string.appendf("XP: %s\n", pipeline.getXferProcessor().name());
28
29 bool scissorEnabled = pipeline.getScissorState().enabled();
30 string.appendf("Scissor: ");
31 if (scissorEnabled) {
32 string.appendf("[L: %d, T: %d, R: %d, B: %d]\n",
33 pipeline.getScissorState().rect().fLeft,
34 pipeline.getScissorState().rect().fTop,
35 pipeline.getScissorState().rect().fRight,
36 pipeline.getScissorState().rect().fBottom);
37 } else {
38 string.appendf("<disabled>\n");
39 }
40 return string;
41 }
42