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

Unified Diff: src/xps/SkXPSDevice.cpp

Issue 2000853003: SkXPS: clean up SkConstexprMath (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-05-22 (Sunday) 13:44:31 EDT Created 4 years, 7 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
« src/xps/SkConstexprMath.h ('K') | « src/xps/SkConstexprMath.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/xps/SkXPSDevice.cpp
diff --git a/src/xps/SkXPSDevice.cpp b/src/xps/SkXPSDevice.cpp
index aef9dc8baf8659b751c966becb167a9ccd3adcda..a9bab8456cd9dec754622f321933e586adb76d61 100644
--- a/src/xps/SkXPSDevice.cpp
+++ b/src/xps/SkXPSDevice.cpp
@@ -202,10 +202,9 @@ HRESULT SkXPSDevice::createXpsThumbnail(IXpsOMPage* page,
"Could not create thumbnail generator.");
SkTScopedComPtr<IOpcPartUri> partUri;
- static const size_t size = SkTUMax<
- SK_ARRAY_COUNT(L"/Documents/1/Metadata/.png") + SK_DIGITS_IN(pageNum),
- SK_ARRAY_COUNT(L"/Metadata/" L_GUID_ID L".png")
- >::value;
+ constexpr size_t size = SkSMax(
+ SK_ARRAY_COUNT(L"/Documents/1/Metadata/.png") + SkDigitsIn<unsigned>(),
+ SK_ARRAY_COUNT(L"/Metadata/" L_GUID_ID L".png"));
wchar_t buffer[size];
if (pageNum > 0) {
swprintf_s(buffer, size, L"/Documents/1/Metadata/%u.png", pageNum);
bungeman-skia 2016/05/23 15:04:49 Eck, now that I look at these, I think this needs
hal.canary 2016/05/23 16:55:39 Acknowledged.
@@ -229,8 +228,8 @@ HRESULT SkXPSDevice::createXpsThumbnail(IXpsOMPage* page,
HRESULT SkXPSDevice::createXpsPage(const XPS_SIZE& pageSize,
IXpsOMPage** page) {
- static const size_t size = SK_ARRAY_COUNT(L"/Documents/1/Pages/.fpage")
- + SK_DIGITS_IN(fCurrentPage);
+ constexpr size_t size = SK_ARRAY_COUNT(L"/Documents/1/Pages/.fpage")
+ + SkDigitsIn<unsigned>();
wchar_t buffer[size];
swprintf_s(buffer, size, L"/Documents/1/Pages/%u.fpage",
this->fCurrentPage);
« src/xps/SkConstexprMath.h ('K') | « src/xps/SkConstexprMath.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698