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

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

Issue 1411723005: Make SkTextBlob::RunIterator public. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-10-27 (Tuesday) 16:20:53 EDT Created 5 years, 1 month 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 | « include/core/SkTextBlob.h ('k') | src/core/SkTextBlob.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 2011 Google Inc. 2 * Copyright 2011 Google Inc.
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 "SkColorFilter.h" 8 #include "SkColorFilter.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
11 #include "SkDrawFilter.h" 11 #include "SkDrawFilter.h"
12 #include "SkImage_Base.h" 12 #include "SkImage_Base.h"
13 #include "SkMetaData.h" 13 #include "SkMetaData.h"
14 #include "SkNinePatchIter.h" 14 #include "SkNinePatchIter.h"
15 #include "SkPatchUtils.h" 15 #include "SkPatchUtils.h"
16 #include "SkPathMeasure.h" 16 #include "SkPathMeasure.h"
17 #include "SkRasterClip.h" 17 #include "SkRasterClip.h"
18 #include "SkRSXform.h" 18 #include "SkRSXform.h"
19 #include "SkShader.h" 19 #include "SkShader.h"
20 #include "SkTextBlob.h" 20 #include "SkTextBlobRunIterator.h"
21 #include "SkTextToPathIter.h" 21 #include "SkTextToPathIter.h"
22 22
23 SkBaseDevice::SkBaseDevice(const SkSurfaceProps& surfaceProps) 23 SkBaseDevice::SkBaseDevice(const SkSurfaceProps& surfaceProps)
24 : fSurfaceProps(surfaceProps) 24 : fSurfaceProps(surfaceProps)
25 #ifdef SK_DEBUG 25 #ifdef SK_DEBUG
26 , fAttachedToCanvas(false) 26 , fAttachedToCanvas(false)
27 #endif 27 #endif
28 { 28 {
29 fOrigin.setZero(); 29 fOrigin.setZero();
30 fMetaData = nullptr; 30 fMetaData = nullptr;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 data.fTexCoords, data.fColors, xmode, data.fIndices, data.fIndexCount, 96 data.fTexCoords, data.fColors, xmode, data.fIndices, data.fIndexCount,
97 paint); 97 paint);
98 } 98 }
99 } 99 }
100 100
101 void SkBaseDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkSc alar x, SkScalar y, 101 void SkBaseDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkSc alar x, SkScalar y,
102 const SkPaint &paint, SkDrawFilter* drawFilter) { 102 const SkPaint &paint, SkDrawFilter* drawFilter) {
103 103
104 SkPaint runPaint = paint; 104 SkPaint runPaint = paint;
105 105
106 SkTextBlob::RunIterator it(blob); 106 SkTextBlobRunIterator it(blob);
107 for (;!it.done(); it.next()) { 107 for (;!it.done(); it.next()) {
108 size_t textLen = it.glyphCount() * sizeof(uint16_t); 108 size_t textLen = it.glyphCount() * sizeof(uint16_t);
109 const SkPoint& offset = it.offset(); 109 const SkPoint& offset = it.offset();
110 // applyFontToPaint() always overwrites the exact same attributes, 110 // applyFontToPaint() always overwrites the exact same attributes,
111 // so it is safe to not re-seed the paint for this reason. 111 // so it is safe to not re-seed the paint for this reason.
112 it.applyFontToPaint(&runPaint); 112 it.applyFontToPaint(&runPaint);
113 113
114 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ e)) { 114 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ e)) {
115 // A false return from filter() means we should abort the current dr aw. 115 // A false return from filter() means we should abort the current dr aw.
116 runPaint = paint; 116 runPaint = paint;
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() 412 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry()
413 || this->onShouldDisableLCD(paint)) { 413 || this->onShouldDisableLCD(paint)) {
414 414
415 flags &= ~SkPaint::kLCDRenderText_Flag; 415 flags &= ~SkPaint::kLCDRenderText_Flag;
416 flags |= SkPaint::kGenA8FromLCD_Flag; 416 flags |= SkPaint::kGenA8FromLCD_Flag;
417 } 417 }
418 418
419 return flags; 419 return flags;
420 } 420 }
421 421
OLDNEW
« no previous file with comments | « include/core/SkTextBlob.h ('k') | src/core/SkTextBlob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698