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

Side by Side Diff: src/gpu/GrStencilAndCoverTextContext.cpp

Issue 1459663002: simplify insertion methods for SkTLList (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix gcc? 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 | « src/gpu/GrReducedClip.cpp ('k') | tests/LListTest.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 2014 Google Inc. 2 * Copyright 2014 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 "GrStencilAndCoverTextContext.h" 8 #include "GrStencilAndCoverTextContext.h"
9 #include "GrAtlasTextContext.h" 9 #include "GrAtlasTextContext.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 200 }
201 201
202 //////////////////////////////////////////////////////////////////////////////// //////////////////// 202 //////////////////////////////////////////////////////////////////////////////// ////////////////////
203 203
204 void GrStencilAndCoverTextContext::TextBlob::init(const SkTextBlob* skBlob, 204 void GrStencilAndCoverTextContext::TextBlob::init(const SkTextBlob* skBlob,
205 const SkPaint& skPaint) { 205 const SkPaint& skPaint) {
206 fCpuMemorySize = sizeof(TextBlob); 206 fCpuMemorySize = sizeof(TextBlob);
207 SkPaint runPaint(skPaint); 207 SkPaint runPaint(skPaint);
208 for (SkTextBlobRunIterator iter(skBlob); !iter.done(); iter.next()) { 208 for (SkTextBlobRunIterator iter(skBlob); !iter.done(); iter.next()) {
209 iter.applyFontToPaint(&runPaint); // No need to re-seed the paint. 209 iter.applyFontToPaint(&runPaint); // No need to re-seed the paint.
210 TextRun* run = SkNEW_INSERT_AT_LLIST_TAIL(this, TextRun, (runPaint)); 210 TextRun* run = this->addToTail(runPaint);
211 211
212 const char* text = reinterpret_cast<const char*>(iter.glyphs()); 212 const char* text = reinterpret_cast<const char*>(iter.glyphs());
213 size_t byteLength = sizeof(uint16_t) * iter.glyphCount(); 213 size_t byteLength = sizeof(uint16_t) * iter.glyphCount();
214 const SkPoint& runOffset = iter.offset(); 214 const SkPoint& runOffset = iter.offset();
215 215
216 switch (iter.positioning()) { 216 switch (iter.positioning()) {
217 case SkTextBlob::kDefault_Positioning: 217 case SkTextBlob::kDefault_Positioning:
218 run->setText(text, byteLength, runOffset.fX, runOffset.fY); 218 run->setText(text, byteLength, runOffset.fX, runOffset.fY);
219 break; 219 break;
220 case SkTextBlob::kHorizontal_Positioning: 220 case SkTextBlob::kHorizontal_Positioning:
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 fBuffIdx = 0; 601 fBuffIdx = 0;
602 } 602 }
603 603
604 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfInit ialized() { 604 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfInit ialized() {
605 if (!this->isInitialized()) { 605 if (!this->isInitialized()) {
606 return nullptr; 606 return nullptr;
607 } 607 }
608 this->flush(); 608 this->flush();
609 return fBuilder->build(); 609 return fBuilder->build();
610 } 610 }
OLDNEW
« no previous file with comments | « src/gpu/GrReducedClip.cpp ('k') | tests/LListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698