0

Roll src/third_party/skia b5fae93:c13bc57 (manual roll)

Summary of changes available at:
https://chromium.googlesource.com/skia/+log/b5fae93..c13bc57

This roll includes SkDevice::drawPosText API changes for GatherPixelRefDevice and VectorPlatformDeviceEmf, needed after https://codereview.chromium.org/605533002.

CQ_EXTRA_TRYBOTS=tryserver.blink:linux_blink_rel,linux_blink_dbg
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/607853003

Cr-Commit-Position: refs/heads/master@{#297168}
This commit is contained in:
fmalita
2014-09-29 07:05:15 -07:00
committed by Commit bot
parent 59379b09a4
commit 7a643ed582
4 changed files with 16 additions and 22 deletions

2
DEPS

@ -35,7 +35,7 @@ vars = {
'boringssl_git': 'https://boringssl.googlesource.com',
'libvpx_revision': 'efe9712d52c2d216fb3d1ceb508b8148847a7e4b',
'sfntly_revision': '1bdaae8fc788a5ac8936d68bf24f37d977a13dac',
'skia_revision': 'b5fae93d72c7b6480f83fd8a7b534cd1fdfcd49a',
'skia_revision': 'c13bc571d3e61a43b87eb97f0719abd304cafaf2',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling Skia
# and V8 without interference from each other.

@ -222,8 +222,8 @@ class GatherPixelRefDevice : public SkBitmapDevice {
const void* text,
size_t len,
const SkScalar pos[],
SkScalar const_y,
int scalars_per_pos,
const SkPoint& offset,
const SkPaint& paint) SK_OVERRIDE {
SkBitmap bitmap;
if (!GetBitmapFromPaint(paint, &bitmap))
@ -235,21 +235,13 @@ class GatherPixelRefDevice : public SkBitmapDevice {
// Similar to SkDraw asserts.
SkASSERT(scalars_per_pos == 1 || scalars_per_pos == 2);
SkPoint min_point;
SkPoint max_point;
if (scalars_per_pos == 1) {
min_point.set(pos[0], const_y);
max_point.set(pos[0], const_y);
} else if (scalars_per_pos == 2) {
min_point.set(pos[0], const_y + pos[1]);
max_point.set(pos[0], const_y + pos[1]);
}
SkPoint min_point = SkPoint::Make(offset.x() + pos[0],
offset.y() + (2 == scalars_per_pos ? pos[1] : 0));
SkPoint max_point = min_point;
for (size_t i = 0; i < len; ++i) {
SkScalar x = pos[i * scalars_per_pos];
SkScalar y = const_y;
if (scalars_per_pos == 2)
y += pos[i * scalars_per_pos + 1];
SkScalar x = offset.x() + pos[i * scalars_per_pos];
SkScalar y = offset.y() + (2 == scalars_per_pos ? pos[i * scalars_per_pos + 1] : 0);
min_point.set(std::min(x, min_point.x()), std::min(y, min_point.y()));
max_point.set(std::max(x, max_point.x()), std::max(y, max_point.y()));

@ -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;
}

@ -59,8 +59,8 @@ class VectorPlatformDeviceEmf : public SkBitmapDevice, public PlatformDevice {
virtual void drawText(const SkDraw& draw, const void* text, size_t len,
SkScalar x, SkScalar y, const SkPaint& paint) OVERRIDE;
virtual void drawPosText(const SkDraw& draw, const void* text, size_t len,
const SkScalar pos[], SkScalar constY,
int scalarsPerPos, const SkPaint& paint) OVERRIDE;
const SkScalar pos[], int scalarsPerPos,
const SkPoint& offset, const SkPaint& paint) OVERRIDE;
virtual void drawTextOnPath(const SkDraw& draw, const void* text, size_t len,
const SkPath& path, const SkMatrix* matrix,
const SkPaint& paint) OVERRIDE;