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/gpu/GrGpu.cpp

Issue 23440049: Implement stroking a path with nv_path_rendering (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 GrVertexBuffer* GrGpu::createVertexBuffer(uint32_t size, bool dynamic) { 190 GrVertexBuffer* GrGpu::createVertexBuffer(uint32_t size, bool dynamic) {
191 this->handleDirtyContext(); 191 this->handleDirtyContext();
192 return this->onCreateVertexBuffer(size, dynamic); 192 return this->onCreateVertexBuffer(size, dynamic);
193 } 193 }
194 194
195 GrIndexBuffer* GrGpu::createIndexBuffer(uint32_t size, bool dynamic) { 195 GrIndexBuffer* GrGpu::createIndexBuffer(uint32_t size, bool dynamic) {
196 this->handleDirtyContext(); 196 this->handleDirtyContext();
197 return this->onCreateIndexBuffer(size, dynamic); 197 return this->onCreateIndexBuffer(size, dynamic);
198 } 198 }
199 199
200 GrPath* GrGpu::createPath(const SkPath& path) { 200 GrPath* GrGpu::createPath(const SkPath& path, const SkStrokeRec& stroke) {
201 SkASSERT(this->caps()->pathRenderingSupport()); 201 SkASSERT(this->caps()->pathRenderingSupport());
202 this->handleDirtyContext(); 202 this->handleDirtyContext();
203 return this->onCreatePath(path); 203 return this->onCreatePath(path, stroke);
204 } 204 }
205 205
206 void GrGpu::clear(const SkIRect* rect, 206 void GrGpu::clear(const SkIRect* rect,
207 GrColor color, 207 GrColor color,
208 GrRenderTarget* renderTarget) { 208 GrRenderTarget* renderTarget) {
209 GrDrawState::AutoRenderTargetRestore art; 209 GrDrawState::AutoRenderTargetRestore art;
210 if (NULL != renderTarget) { 210 if (NULL != renderTarget) {
211 art.set(this->drawState(), renderTarget); 211 art.set(this->drawState(), renderTarget);
212 } 212 }
213 if (NULL == this->getDrawState().getRenderTarget()) { 213 if (NULL == this->getDrawState().getRenderTarget()) {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 this->drawState()->setPathStencilFillType(fill); 355 this->drawState()->setPathStencilFillType(fill);
356 356
357 GrDrawState::AutoRestoreEffects are; 357 GrDrawState::AutoRestoreEffects are;
358 if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) { 358 if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) {
359 return; 359 return;
360 } 360 }
361 361
362 this->onGpuStencilPath(path, fill); 362 this->onGpuStencilPath(path, fill);
363 } 363 }
364 364
365 void GrGpu::onFillPath(const GrPath* path, const SkStrokeRec& stroke, SkPath::Fi llType fill) { 365 void GrGpu::onDrawPath(const GrPath* path, const SkStrokeRec& stroke, SkPath::Fi llType fill) {
366 this->handleDirtyContext(); 366 this->handleDirtyContext();
367 367
368 this->drawState()->setPathStencilFillType(fill); 368 this->drawState()->setPathStencilFillType(fill);
369 369
370 GrDrawState::AutoRestoreEffects are; 370 GrDrawState::AutoRestoreEffects are;
371 // TODO: Some blending effects require destination texture, see onDraw 371 // TODO: Some blending effects require destination texture, see onDraw
372 if (!this->setupClipAndFlushState(kFillPath_DrawType, NULL, &are)) { 372 if (!this->setupClipAndFlushState(kDrawPath_DrawType, NULL, &are)) {
373 return; 373 return;
374 } 374 }
375 375
376 this->onGpuFillPath(path, fill); 376 this->onGpuDrawPath(path, stroke, fill);
377 } 377 }
378 378
379 void GrGpu::finalizeReservedVertices() { 379 void GrGpu::finalizeReservedVertices() {
380 SkASSERT(NULL != fVertexPool); 380 SkASSERT(NULL != fVertexPool);
381 fVertexPool->unlock(); 381 fVertexPool->unlock();
382 } 382 }
383 383
384 void GrGpu::finalizeReservedIndices() { 384 void GrGpu::finalizeReservedIndices() {
385 SkASSERT(NULL != fIndexPool); 385 SkASSERT(NULL != fIndexPool);
386 fIndexPool->unlock(); 386 fIndexPool->unlock();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 } 506 }
507 507
508 void GrGpu::releaseIndexArray() { 508 void GrGpu::releaseIndexArray() {
509 // if index source was array, we stowed data in the pool 509 // if index source was array, we stowed data in the pool
510 const GeometrySrcState& geoSrc = this->getGeomSrc(); 510 const GeometrySrcState& geoSrc = this->getGeomSrc();
511 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); 511 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc);
512 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); 512 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t);
513 fIndexPool->putBack(bytes); 513 fIndexPool->putBack(bytes);
514 --fIndexPoolUseCnt; 514 --fIndexPoolUseCnt;
515 } 515 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | src/gpu/gl/GrGLPath.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698