LCOV - code coverage report
Current view: top level - gfx/skia/skia/src/gpu/ops - GrDrawAtlasOp.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 23 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 14 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : #ifndef GrDrawAtlasOp_DEFINED
       9             : #define GrDrawAtlasOp_DEFINED
      10             : 
      11             : #include "GrColor.h"
      12             : #include "GrDefaultGeoProcFactory.h"
      13             : #include "GrMeshDrawOp.h"
      14             : 
      15           0 : class GrDrawAtlasOp final : public GrLegacyMeshDrawOp {
      16             : public:
      17           0 :     DEFINE_OP_CLASS_ID
      18             : 
      19           0 :     static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
      20             :                                                     int spriteCount, const SkRSXform* xforms,
      21             :                                                     const SkRect* rects, const SkColor* colors) {
      22             :         return std::unique_ptr<GrLegacyMeshDrawOp>(
      23           0 :                 new GrDrawAtlasOp(color, viewMatrix, spriteCount, xforms, rects, colors));
      24             :     }
      25             : 
      26           0 :     const char* name() const override { return "DrawAtlasOp"; }
      27             : 
      28           0 :     SkString dumpInfo() const override {
      29           0 :         SkString string;
      30           0 :         for (const auto& geo : fGeoData) {
      31           0 :             string.appendf("Color: 0x%08x, Quads: %d\n", geo.fColor, geo.fVerts.count() / 4);
      32             :         }
      33           0 :         string.append(DumpPipelineInfo(*this->pipeline()));
      34           0 :         string.append(INHERITED::dumpInfo());
      35           0 :         return string;
      36             :     }
      37             : 
      38             : private:
      39             :     GrDrawAtlasOp(GrColor color, const SkMatrix& viewMatrix, int spriteCount,
      40             :                   const SkRSXform* xforms, const SkRect* rects, const SkColor* colors);
      41             : 
      42           0 :     void getProcessorAnalysisInputs(GrProcessorAnalysisColor* color,
      43             :                                     GrProcessorAnalysisCoverage* coverage) const override {
      44           0 :         if (this->hasColors()) {
      45           0 :             color->setToUnknown();
      46             :         } else {
      47           0 :             color->setToConstant(fGeoData[0].fColor);
      48             :         }
      49           0 :         *coverage = GrProcessorAnalysisCoverage::kNone;
      50           0 :     }
      51             : 
      52             :     void onPrepareDraws(Target*) const override;
      53             : 
      54             :     void applyPipelineOptimizations(const PipelineOptimizations&) override;
      55             : 
      56           0 :     GrColor color() const { return fColor; }
      57           0 :     const SkMatrix& viewMatrix() const { return fViewMatrix; }
      58           0 :     bool hasColors() const { return fHasColors; }
      59           0 :     int quadCount() const { return fQuadCount; }
      60             : 
      61             :     bool onCombineIfPossible(GrOp* t, const GrCaps&) override;
      62             : 
      63           0 :     struct Geometry {
      64             :         GrColor fColor;
      65             :         SkTArray<uint8_t, true> fVerts;
      66             :     };
      67             : 
      68             :     SkSTArray<1, Geometry, true> fGeoData;
      69             : 
      70             :     SkMatrix fViewMatrix;
      71             :     GrColor fColor;
      72             :     int fQuadCount;
      73             :     bool fHasColors;
      74             : 
      75             :     typedef GrLegacyMeshDrawOp INHERITED;
      76             : };
      77             : 
      78             : #endif

Generated by: LCOV version 1.13