LCOV - code coverage report
Current view: top level - gfx/skia/skia/src/core - SkXfermodeInterpretation.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 19 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 2 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             : #include "SkXfermodeInterpretation.h"
       9             : #include "SkPaint.h"
      10             : 
      11           0 : static bool just_solid_color(const SkPaint& p) {
      12           0 :     return SK_AlphaOPAQUE == p.getAlpha() && !p.getColorFilter() && !p.getShader();
      13             : }
      14             : 
      15           0 : SkXfermodeInterpretation SkInterpretXfermode(const SkPaint& paint, bool dstIsOpaque) {
      16           0 :     switch (paint.getBlendMode()) {
      17             :         case SkBlendMode::kSrcOver:
      18           0 :             return kSrcOver_SkXfermodeInterpretation;
      19             :         case SkBlendMode::kSrc:
      20           0 :             if (just_solid_color(paint)) {
      21           0 :                 return kSrcOver_SkXfermodeInterpretation;
      22             :             }
      23           0 :             return kNormal_SkXfermodeInterpretation;
      24             :         case SkBlendMode::kDst:
      25           0 :             return kSkipDrawing_SkXfermodeInterpretation;
      26             :         case SkBlendMode::kDstOver:
      27           0 :             if (dstIsOpaque) {
      28           0 :                 return kSkipDrawing_SkXfermodeInterpretation;
      29             :             }
      30           0 :             return kNormal_SkXfermodeInterpretation;
      31             :         case SkBlendMode::kSrcIn:
      32           0 :             if (dstIsOpaque && just_solid_color(paint)) {
      33           0 :                 return kSrcOver_SkXfermodeInterpretation;
      34             :             }
      35           0 :             return kNormal_SkXfermodeInterpretation;
      36             :         case SkBlendMode::kDstIn:
      37           0 :             if (just_solid_color(paint)) {
      38           0 :                 return kSkipDrawing_SkXfermodeInterpretation;
      39             :             }
      40           0 :             return kNormal_SkXfermodeInterpretation;
      41             :         default:
      42           0 :             return kNormal_SkXfermodeInterpretation;
      43             :     }
      44             : }

Generated by: LCOV version 1.13