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

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

Issue 563283004: Use per-typeface sets of glyphs for nvpr text (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_glyphmemorypath
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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 this->handleDirtyContext(); 163 this->handleDirtyContext();
164 return this->onCreateIndexBuffer(size, dynamic); 164 return this->onCreateIndexBuffer(size, dynamic);
165 } 165 }
166 166
167 GrPath* GrGpu::createPath(const SkPath& path, const SkStrokeRec& stroke) { 167 GrPath* GrGpu::createPath(const SkPath& path, const SkStrokeRec& stroke) {
168 SkASSERT(this->caps()->pathRenderingSupport()); 168 SkASSERT(this->caps()->pathRenderingSupport());
169 this->handleDirtyContext(); 169 this->handleDirtyContext();
170 return this->pathRendering()->createPath(path, stroke); 170 return this->pathRendering()->createPath(path, stroke);
171 } 171 }
172 172
173 GrPathRange* GrGpu::createPathRange(size_t size, const SkStrokeRec& stroke) { 173 GrPathRange* GrGpu::createGlyphs(const SkTypeface* typeface,
174 const SkDescriptor* desc,
175 const SkStrokeRec& stroke) {
174 this->handleDirtyContext(); 176 this->handleDirtyContext();
175 return this->pathRendering()->createPathRange(size, stroke); 177 return this->pathRendering()->createGlyphs(typeface, desc, stroke);
176 } 178 }
177 179
178 void GrGpu::clear(const SkIRect* rect, 180 void GrGpu::clear(const SkIRect* rect,
179 GrColor color, 181 GrColor color,
180 bool canIgnoreRect, 182 bool canIgnoreRect,
181 GrRenderTarget* renderTarget) { 183 GrRenderTarget* renderTarget) {
182 if (NULL == renderTarget) { 184 if (NULL == renderTarget) {
183 renderTarget = this->getDrawState().getRenderTarget(); 185 renderTarget = this->getDrawState().getRenderTarget();
184 } 186 }
185 if (NULL == renderTarget) { 187 if (NULL == renderTarget) {
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 SkPath::FillType fill, const GrDeviceCoordTexture* dstCo py) { 384 SkPath::FillType fill, const GrDeviceCoordTexture* dstCo py) {
383 this->handleDirtyContext(); 385 this->handleDirtyContext();
384 386
385 drawState()->setDefaultVertexAttribs(); 387 drawState()->setDefaultVertexAttribs();
386 388
387 GrDrawState::AutoRestoreEffects are; 389 GrDrawState::AutoRestoreEffects are;
388 if (!this->setupClipAndFlushState(kDrawPaths_DrawType, dstCopy, &are, NULL)) { 390 if (!this->setupClipAndFlushState(kDrawPaths_DrawType, dstCopy, &are, NULL)) {
389 return; 391 return;
390 } 392 }
391 393
394 pathRange->willDrawPaths(indices, count);
392 this->pathRendering()->drawPaths(pathRange, indices, count, transforms, tran sformsType, fill); 395 this->pathRendering()->drawPaths(pathRange, indices, count, transforms, tran sformsType, fill);
393 } 396 }
394 397
395 void GrGpu::finalizeReservedVertices() { 398 void GrGpu::finalizeReservedVertices() {
396 SkASSERT(fVertexPool); 399 SkASSERT(fVertexPool);
397 fVertexPool->unmap(); 400 fVertexPool->unmap();
398 } 401 }
399 402
400 void GrGpu::finalizeReservedIndices() { 403 void GrGpu::finalizeReservedIndices() {
401 SkASSERT(fIndexPool); 404 SkASSERT(fIndexPool);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } 525 }
523 526
524 void GrGpu::releaseIndexArray() { 527 void GrGpu::releaseIndexArray() {
525 // if index source was array, we stowed data in the pool 528 // if index source was array, we stowed data in the pool
526 const GeometrySrcState& geoSrc = this->getGeomSrc(); 529 const GeometrySrcState& geoSrc = this->getGeomSrc();
527 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); 530 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc);
528 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); 531 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t);
529 fIndexPool->putBack(bytes); 532 fIndexPool->putBack(bytes);
530 --fIndexPoolUseCnt; 533 --fIndexPoolUseCnt;
531 } 534 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698