Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: src/codec/SkRawCodec.cpp

Issue 1641533004: Enable RAW codec for Windows (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« gyp/codec.gyp ('K') | « gyp/dng_sdk.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkRawCodec.cpp
diff --git a/src/codec/SkRawCodec.cpp b/src/codec/SkRawCodec.cpp
index 79590d18324805add915f18ed9c80c1b7162838c..130ffeda3897dae22f3833e45f7bedcdcbe6fad9 100644
--- a/src/codec/SkRawCodec.cpp
+++ b/src/codec/SkRawCodec.cpp
@@ -151,7 +151,7 @@ public:
ThrowReadFile();
}
- if (!fStreamBuffer.read(data, offset, count)) {
+ if (!fStreamBuffer.read(data, static_cast<size_t>(offset), count)) {
ThrowReadFile();
}
}
@@ -304,9 +304,10 @@ private:
fNegative->PostParse(*fHost, *fDngStream, *fInfo);
fNegative->SynchronizeMetadata();
- fImageInfo = SkImageInfo::Make(fNegative->DefaultCropSizeH().As_real64(),
- fNegative->DefaultCropSizeV().As_real64(),
- kN32_SkColorType, kOpaque_SkAlphaType);
+ fImageInfo = SkImageInfo::Make(
+ static_cast<int>(fNegative->DefaultCropSizeH().As_real64()),
+ static_cast<int>(fNegative->DefaultCropSizeV().As_real64()),
+ kN32_SkColorType, kOpaque_SkAlphaType);
// The DNG SDK scales only for at demosaicing, so only when a mosaic info
// is available also scale is available.
@@ -441,7 +442,7 @@ SkISize SkRawCodec::onGetScaledDimensions(float desiredScale) const {
}
// Limits the minimum size to be 80 on the short edge.
- const float shortEdge = SkTMin(dim.fWidth, dim.fHeight);
+ const float shortEdge = static_cast<float>(SkTMin(dim.fWidth, dim.fHeight));
if (desiredScale < 80.f / shortEdge) {
desiredScale = 80.f / shortEdge;
}
@@ -454,14 +455,14 @@ SkISize SkRawCodec::onGetScaledDimensions(float desiredScale) const {
// Round to integer-factors.
const float finalScale = std::floor(1.f/ desiredScale);
- return SkISize::Make(std::floor(dim.fWidth / finalScale),
- std::floor(dim.fHeight / finalScale));
+ return SkISize::Make(static_cast<int32_t>(std::floor(dim.fWidth / finalScale)),
+ static_cast<int32_t>(std::floor(dim.fHeight / finalScale)));
}
bool SkRawCodec::onDimensionsSupported(const SkISize& dim) {
const SkISize fullDim = this->getInfo().dimensions();
- const float fullShortEdge = SkTMin(fullDim.fWidth, fullDim.fHeight);
- const float shortEdge = SkTMin(dim.fWidth, dim.fHeight);
+ const float fullShortEdge = static_cast<float>(SkTMin(fullDim.fWidth, fullDim.fHeight));
+ const float shortEdge = static_cast<float>(SkTMin(dim.fWidth, dim.fHeight));
SkISize sizeFloor = this->onGetScaledDimensions(1.f / std::floor(fullShortEdge / shortEdge));
SkISize sizeCeil = this->onGetScaledDimensions(1.f / std::ceil(fullShortEdge / shortEdge));
« gyp/codec.gyp ('K') | « gyp/dng_sdk.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698