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

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-23 (Monday) 12:51:27 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
« no previous file with comments | « 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..c7f03d33cd805c64646ce638418ab77a11b9967d 100644
--- a/src/xps/SkXPSDevice.cpp
+++ b/src/xps/SkXPSDevice.cpp
@@ -18,9 +18,9 @@
#include <XpsObjectModel.h>
#include <T2EmbApi.h>
#include <FontSub.h>
+#include <limits>
#include "SkColor.h"
-#include "SkConstexprMath.h"
#include "SkData.h"
#include "SkDraw.h"
#include "SkEndian.h"
@@ -202,10 +202,10 @@ 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 = SkTMax<size_t>(
bungeman-skia 2016/05/23 18:12:38 Both parameters are size_t now, so it shouldn't ne
hal.canary 2016/05/28 17:05:54 Done.
+ SK_ARRAY_COUNT(L"/Documents/1/Metadata/.png")
+ + static_cast<size_t>(std::numeric_limits<unsigned>::digits10 + 1),
bungeman-skia 2016/05/23 18:12:38 It's rather annoying that this indentation kinda h
hal.canary 2016/05/28 17:05:54 Done.
+ 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);
@@ -229,8 +229,9 @@ 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")
+ + static_cast<size_t>(std::numeric_limits<unsigned>::digits10 + 1);
wchar_t buffer[size];
swprintf_s(buffer, size, L"/Documents/1/Pages/%u.fpage",
this->fCurrentPage);
« no previous file with comments | « src/xps/SkConstexprMath.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698