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

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: rebase Created 7 years, 2 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
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('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 /* 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 this->handleDirtyContext(); 375 this->handleDirtyContext();
376 GrDrawState::AutoRestoreEffects are; 376 GrDrawState::AutoRestoreEffects are;
377 if (!this->setupClipAndFlushState(PrimTypeToDrawType(info.primitiveType()), 377 if (!this->setupClipAndFlushState(PrimTypeToDrawType(info.primitiveType()),
378 info.getDstCopy(), 378 info.getDstCopy(),
379 &are)) { 379 &are)) {
380 return; 380 return;
381 } 381 }
382 this->onGpuDraw(info); 382 this->onGpuDraw(info);
383 } 383 }
384 384
385 void GrGpu::onStencilPath(const GrPath* path, const SkStrokeRec&, SkPath::FillTy pe fill) { 385 void GrGpu::onStencilPath(const GrPath* path, SkPath::FillType fill) {
386 this->handleDirtyContext(); 386 this->handleDirtyContext();
387 387
388 GrDrawState::AutoRestoreEffects are; 388 GrDrawState::AutoRestoreEffects are;
389 if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) { 389 if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) {
390 return; 390 return;
391 } 391 }
392 392
393 this->onGpuStencilPath(path, fill); 393 this->onGpuStencilPath(path, fill);
394 } 394 }
395 395
396 void GrGpu::onFillPath(const GrPath* path, const SkStrokeRec& stroke, SkPath::Fi llType fill, 396
397 void GrGpu::onDrawPath(const GrPath* path, SkPath::FillType fill,
397 const GrDeviceCoordTexture* dstCopy) { 398 const GrDeviceCoordTexture* dstCopy) {
398 this->handleDirtyContext(); 399 this->handleDirtyContext();
399 400
400 drawState()->setDefaultVertexAttribs(); 401 drawState()->setDefaultVertexAttribs();
401 402
402 GrDrawState::AutoRestoreEffects are; 403 GrDrawState::AutoRestoreEffects are;
403 if (!this->setupClipAndFlushState(kFillPath_DrawType, dstCopy, &are)) { 404 if (!this->setupClipAndFlushState(kDrawPath_DrawType, dstCopy, &are)) {
404 return; 405 return;
405 } 406 }
406 407
407 this->onGpuFillPath(path, fill); 408 this->onGpuDrawPath(path, fill);
408 } 409 }
409 410
410 void GrGpu::finalizeReservedVertices() { 411 void GrGpu::finalizeReservedVertices() {
411 SkASSERT(NULL != fVertexPool); 412 SkASSERT(NULL != fVertexPool);
412 fVertexPool->unlock(); 413 fVertexPool->unlock();
413 } 414 }
414 415
415 void GrGpu::finalizeReservedIndices() { 416 void GrGpu::finalizeReservedIndices() {
416 SkASSERT(NULL != fIndexPool); 417 SkASSERT(NULL != fIndexPool);
417 fIndexPool->unlock(); 418 fIndexPool->unlock();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 } 538 }
538 539
539 void GrGpu::releaseIndexArray() { 540 void GrGpu::releaseIndexArray() {
540 // if index source was array, we stowed data in the pool 541 // if index source was array, we stowed data in the pool
541 const GeometrySrcState& geoSrc = this->getGeomSrc(); 542 const GeometrySrcState& geoSrc = this->getGeomSrc();
542 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); 543 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc);
543 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); 544 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t);
544 fIndexPool->putBack(bytes); 545 fIndexPool->putBack(bytes);
545 --fIndexPoolUseCnt; 546 --fIndexPoolUseCnt;
546 } 547 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698