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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 609223003: Revert of Fix SkTextBlob offset semantics. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkCanvasPriv.h" 9 #include "SkCanvasPriv.h"
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2133 iter.fDevice->drawText(iter, text, byteLength, x, y, dfp.paint()); 2133 iter.fDevice->drawText(iter, text, byteLength, x, y, dfp.paint());
2134 DrawTextDecorations(iter, dfp.paint(), 2134 DrawTextDecorations(iter, dfp.paint(),
2135 static_cast<const char*>(text), byteLength, x, y); 2135 static_cast<const char*>(text), byteLength, x, y);
2136 } 2136 }
2137 2137
2138 LOOPER_END 2138 LOOPER_END
2139 } 2139 }
2140 2140
2141 void SkCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[], 2141 void SkCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
2142 const SkPaint& paint) { 2142 const SkPaint& paint) {
2143 SkPoint textOffset = SkPoint::Make(0, 0);
2144
2145 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL) 2143 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
2146 2144
2147 while (iter.next()) { 2145 while (iter.next()) {
2148 SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint()); 2146 SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint());
2149 iter.fDevice->drawPosText(iter, text, byteLength, &pos->fX, 2, textOffse t, 2147 iter.fDevice->drawPosText(iter, text, byteLength, &pos->fX, 0, 2,
2150 dfp.paint()); 2148 dfp.paint());
2151 } 2149 }
2152 2150
2153 LOOPER_END 2151 LOOPER_END
2154 } 2152 }
2155 2153
2156 void SkCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScala r xpos[], 2154 void SkCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScala r xpos[],
2157 SkScalar constY, const SkPaint& paint) { 2155 SkScalar constY, const SkPaint& paint) {
2158
2159 SkPoint textOffset = SkPoint::Make(0, constY);
2160
2161 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL) 2156 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
2162 2157
2163 while (iter.next()) { 2158 while (iter.next()) {
2164 SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint()); 2159 SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint());
2165 iter.fDevice->drawPosText(iter, text, byteLength, xpos, 1, textOffset, 2160 iter.fDevice->drawPosText(iter, text, byteLength, xpos, constY, 1,
2166 dfp.paint()); 2161 dfp.paint());
2167 } 2162 }
2168 2163
2169 LOOPER_END 2164 LOOPER_END
2170 } 2165 }
2171 2166
2172 void SkCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPat h& path, 2167 void SkCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPat h& path,
2173 const SkMatrix* matrix, const SkPaint& paint) { 2168 const SkMatrix* matrix, const SkPaint& paint) {
2174 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL) 2169 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
2175 2170
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 } 2536 }
2542 2537
2543 if (matrix) { 2538 if (matrix) {
2544 canvas->concat(*matrix); 2539 canvas->concat(*matrix);
2545 } 2540 }
2546 } 2541 }
2547 2542
2548 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2543 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2549 fCanvas->restoreToCount(fSaveCount); 2544 fCanvas->restoreToCount(fSaveCount);
2550 } 2545 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698