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

Unified Diff: skia/ext/vector_platform_device_emf_win.cc

Issue 607853003: Roll src/third_party/skia b5fae93:c13bc57 (manual roll) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Win emf fix Created 6 years, 3 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 | « skia/ext/vector_platform_device_emf_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/vector_platform_device_emf_win.cc
diff --git a/skia/ext/vector_platform_device_emf_win.cc b/skia/ext/vector_platform_device_emf_win.cc
index f3063165bfbe9130746acdd932e6aaa83494a7d1..19e30668d9519f675ba370821fdfd2c81e1364e1 100644
--- a/skia/ext/vector_platform_device_emf_win.cc
+++ b/skia/ext/vector_platform_device_emf_win.cc
@@ -510,8 +510,8 @@ void VectorPlatformDeviceEmf::drawPosText(const SkDraw& draw,
const void* text,
size_t len,
const SkScalar pos[],
- SkScalar constY,
int scalarsPerPos,
+ const SkPoint& offset,
const SkPaint& paint) {
SkGDIFontSetup setup;
bool useDrawText = true;
@@ -519,8 +519,8 @@ void VectorPlatformDeviceEmf::drawPosText(const SkDraw& draw,
if (scalarsPerPos == 2 && len >= 2 &&
SkPaint::kUTF8_TextEncoding != paint.getTextEncoding() &&
setup.useGDI(hdc_, paint)) {
- int startX = SkScalarRoundToInt(pos[0]);
- int startY = SkScalarRoundToInt(pos[1] + getAscent(paint));
+ int startX = SkScalarRoundToInt(pos[0] + offset.x());
+ int startY = SkScalarRoundToInt(pos[1] + offset.y() + getAscent(paint));
const int count = len >> 1;
SkAutoSTMalloc<64, INT> storage(count);
INT* advances = storage.get();
@@ -552,9 +552,11 @@ void VectorPlatformDeviceEmf::drawPosText(const SkDraw& draw,
const char* curr = reinterpret_cast<const char*>(text);
const char* stop = curr + len;
while (curr < stop) {
- SkScalar y = (1 == scalarsPerPos) ? constY : pos[1];
+ SkScalar x = offset.x() + pos[0];
+ SkScalar y = offset.y() + (2 == scalarsPerPos ? pos[1] : 0);
+
size_t bytes = bytesPerCodePoint(curr);
- drawText(draw, curr, bytes, pos[0], y, paint);
+ drawText(draw, curr, bytes, x, y, paint);
curr += bytes;
pos += scalarsPerPos;
}
« no previous file with comments | « skia/ext/vector_platform_device_emf_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698