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

Side by Side Diff: src/views/SkTextBox.cpp

Issue 577243002: update to accommodate latest clang in chrome toolchain (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/ports/SkFontHost_FreeType.cpp ('k') | src/views/SkViewPriv.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 2006 The Android Open Source Project 2 * Copyright 2006 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 "SkTextBox.h" 8 #include "SkTextBox.h"
9 #include "SkUtils.h" 9 #include "SkUtils.h"
10 10
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void SkTextBox::setSpacing(SkScalar mul, SkScalar add) 160 void SkTextBox::setSpacing(SkScalar mul, SkScalar add)
161 { 161 {
162 fSpacingMul = mul; 162 fSpacingMul = mul;
163 fSpacingAdd = add; 163 fSpacingAdd = add;
164 } 164 }
165 165
166 //////////////////////////////////////////////////////////////////////////////// ///////////// 166 //////////////////////////////////////////////////////////////////////////////// /////////////
167 167
168 void SkTextBox::draw(SkCanvas* canvas, const char text[], size_t len, const SkPa int& paint) 168 void SkTextBox::draw(SkCanvas* canvas, const char text[], size_t len, const SkPa int& paint)
169 { 169 {
170 SkASSERT(canvas && &paint && (text || len == 0)); 170 SkASSERT(canvas && (text || len == 0));
171 171
172 SkScalar marginWidth = fBox.width(); 172 SkScalar marginWidth = fBox.width();
173 173
174 if (marginWidth <= 0 || len == 0) 174 if (marginWidth <= 0 || len == 0)
175 return; 175 return;
176 176
177 const char* textStop = text + len; 177 const char* textStop = text + len;
178 178
179 SkScalar x, y, scaledSpacing, height, fontHeight; 179 SkScalar x, y, scaledSpacing, height, fontHeight;
180 SkPaint::FontMetrics metrics; 180 SkPaint::FontMetrics metrics;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 251
252 int SkTextBox::countLines() const { 252 int SkTextBox::countLines() const {
253 return SkTextLineBreaker::CountLines(fText, fLen, *fPaint, fBox.width()); 253 return SkTextLineBreaker::CountLines(fText, fLen, *fPaint, fBox.width());
254 } 254 }
255 255
256 SkScalar SkTextBox::getTextHeight() const { 256 SkScalar SkTextBox::getTextHeight() const {
257 SkScalar spacing = SkScalarMul(fPaint->getTextSize(), fSpacingMul) + fSpacin gAdd; 257 SkScalar spacing = SkScalarMul(fPaint->getTextSize(), fSpacingMul) + fSpacin gAdd;
258 return this->countLines() * spacing; 258 return this->countLines() * spacing;
259 } 259 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_FreeType.cpp ('k') | src/views/SkViewPriv.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698