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

Unified Diff: skia/ext/pixel_ref_utils.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 | « DEPS ('k') | skia/ext/vector_platform_device_emf_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/pixel_ref_utils.cc
diff --git a/skia/ext/pixel_ref_utils.cc b/skia/ext/pixel_ref_utils.cc
index 85a4e4896abc6ad499a8448b2664653f3c7dbca8..33ae11b9dc3d1c350d80de3564c9bf96bc5bc81d 100644
--- a/skia/ext/pixel_ref_utils.cc
+++ b/skia/ext/pixel_ref_utils.cc
@@ -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()));
« no previous file with comments | « DEPS ('k') | skia/ext/vector_platform_device_emf_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698