aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-02-09 13:26:46 -0500
committerGravatar Mike Reed <reed@google.com>2018-02-09 20:38:32 +0000
commit7fcfb621998648ba018e3b89e2cab3135bd46a1f (patch)
treece43ae14602539ef7b541e91cc1372c1ee4b4e0e /src/codec
parent47cf048abecb5064b9e851ea01f75b23797c1611 (diff)
move a bunch of helpers from SkImageInfo.h into priv
Bug: skia: Change-Id: I8c91cfdb89e4f22448d1201d391556fe43d86dca Reviewed-on: https://skia-review.googlesource.com/105289 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src/codec')
-rw-r--r--src/codec/SkCodec.cpp2
-rw-r--r--src/codec/SkGifCodec.cpp2
-rw-r--r--src/codec/SkSwizzler.cpp2
-rw-r--r--src/codec/SkWebpCodec.cpp2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index b2902ca75f..53fa6f4643 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -214,7 +214,7 @@ static void zero_rect(const SkImageInfo& dstInfo, void* pixels, size_t rowBytes,
return;
}
const auto info = dstInfo.makeWH(frameRect.width(), frameRect.height());
- const size_t bpp = SkColorTypeBytesPerPixel(dstInfo.colorType());
+ const size_t bpp = dstInfo.bytesPerPixel();
const size_t offset = frameRect.x() * bpp + frameRect.y() * rowBytes;
auto* eraseDst = SkTAddOffset<void>(pixels, offset);
SkSampler::Fill(info, eraseDst, rowBytes, 0, SkCodec::kNo_ZeroInitialized);
diff --git a/src/codec/SkGifCodec.cpp b/src/codec/SkGifCodec.cpp
index dff8136d75..1118ed0e7d 100644
--- a/src/codec/SkGifCodec.cpp
+++ b/src/codec/SkGifCodec.cpp
@@ -541,7 +541,7 @@ void SkGifCodec::haveDecodedRow(int frameIndex, const unsigned char* rowBegin,
// Tell the frame to copy the row data if need be.
if (repeatCount > 1) {
- const size_t bytesPerPixel = SkColorTypeBytesPerPixel(this->dstInfo().colorType());
+ const size_t bytesPerPixel = this->dstInfo().bytesPerPixel();
const size_t bytesToCopy = fSwizzler->swizzleWidth() * bytesPerPixel;
void* copiedLine = SkTAddOffset<void>(dstLine, fSwizzler->swizzleOffsetBytes());
void* dst = copiedLine;
diff --git a/src/codec/SkSwizzler.cpp b/src/codec/SkSwizzler.cpp
index f3d97af3d8..4b350c4ec4 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -786,7 +786,7 @@ SkSwizzler* SkSwizzler::CreateSwizzler(const SkEncodedInfo& encodedInfo,
RowProc fastProc = nullptr;
RowProc proc = nullptr;
int srcBPP;
- const int dstBPP = SkColorTypeBytesPerPixel(dstInfo.colorType());
+ const int dstBPP = dstInfo.bytesPerPixel();
if (skipFormatConversion) {
switch (encodedInfo.color()) {
case SkEncodedInfo::kGray_Color:
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp
index 6618072c8a..95ae9b9593 100644
--- a/src/codec/SkWebpCodec.cpp
+++ b/src/codec/SkWebpCodec.cpp
@@ -617,7 +617,7 @@ SkCodec::Result SkWebpCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst,
const bool needsSrgbToLinear = dstInfo.gammaCloseToSRGB() &&
options.fPremulBehavior == SkTransferFunctionBehavior::kRespect;
- const size_t dstBpp = SkColorTypeBytesPerPixel(dstInfo.colorType());
+ const size_t dstBpp = dstInfo.bytesPerPixel();
dst = SkTAddOffset<void>(dst, dstBpp * dstX + rowBytes * dstY);
const size_t srcRowBytes = config.output.u.RGBA.stride;