LCOV - code coverage report
Current view: top level - gfx/skia/skia/src/core - SkUnPreMultiplyPriv.h (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 2017 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 SkUnPreMultiplyPriv_DEFINED
       9             : #define SkUnPreMultiplyPriv_DEFINED
      10             : 
      11             : #include "SkColor.h"
      12             : 
      13             : template <bool kSwapRB>
      14           0 : void SkUnpremultiplyRow(uint32_t* dst, const uint32_t* src, int count) {
      15           0 :     const SkUnPreMultiply::Scale* table = SkUnPreMultiply::GetScaleTable();
      16             : 
      17           0 :     for (int i = 0; i < count; i++) {
      18           0 :         uint32_t c = *src++;
      19             :         uint8_t r, g, b, a;
      20             :         if (kSwapRB) {
      21           0 :             r = (c >> 16) & 0xFF;
      22           0 :             g = (c >>  8) & 0xFF;
      23           0 :             b = (c >>  0) & 0xFF;
      24           0 :             a = (c >> 24) & 0xFF;
      25             :         } else {
      26           0 :             r = (c >>  0) & 0xFF;
      27           0 :             g = (c >>  8) & 0xFF;
      28           0 :             b = (c >> 16) & 0xFF;
      29           0 :             a = (c >> 24) & 0xFF;
      30             :         }
      31             : 
      32           0 :         if (0 != a && 255 != a) {
      33           0 :             SkUnPreMultiply::Scale scale = table[a];
      34           0 :             r = SkUnPreMultiply::ApplyScale(scale, r);
      35           0 :             g = SkUnPreMultiply::ApplyScale(scale, g);
      36           0 :             b = SkUnPreMultiply::ApplyScale(scale, b);
      37             :         }
      38             : 
      39           0 :         *dst++ = (r << 0) | (g << 8) | (b << 16) | (a << 24);
      40             :     }
      41           0 : }
      42             : 
      43             : #endif

Generated by: LCOV version 1.13