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

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

Issue 22686002: Implement path cover with nv_path_rendering (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebased to issue 23537028 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 info.getDstCopy(), 342 info.getDstCopy(),
343 &are)) { 343 &are)) {
344 return; 344 return;
345 } 345 }
346 this->onGpuDraw(info); 346 this->onGpuDraw(info);
347 } 347 }
348 348
349 void GrGpu::onStencilPath(const GrPath* path, const SkStrokeRec&, SkPath::FillTy pe fill) { 349 void GrGpu::onStencilPath(const GrPath* path, const SkStrokeRec&, SkPath::FillTy pe fill) {
350 this->handleDirtyContext(); 350 this->handleDirtyContext();
351 351
352 // TODO: make this more efficient (don't copy and copy back) 352 this->drawState()->setStencilPathSettings(this->getStencilPathSettings(*path , fill));
353 GrAutoTRestore<GrStencilSettings> asr(this->drawState()->stencil());
354 353
355 this->setStencilPathSettings(*path, fill, this->drawState()->stencil());
356 GrDrawState::AutoRestoreEffects are; 354 GrDrawState::AutoRestoreEffects are;
357 if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) { 355 if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) {
358 return; 356 return;
359 } 357 }
360 358
361 this->onGpuStencilPath(path, fill); 359 this->onGpuStencilPath(path, fill);
362 } 360 }
363 361
362 void GrGpu::onDrawPath(const GrPath* path, const SkStrokeRec& stroke, SkPath::Fi llType fill) {
363 this->handleDirtyContext();
364
365 this->drawState()->setStencilPathSettings(this->getStencilPathSettings(*path , fill));
366
367 GrDrawState::AutoRestoreEffects are;
368 // TODO: Some blending effects require destination texture, see onDraw
369 if (!this->setupClipAndFlushState(kDrawPath_DrawType, NULL, &are)) {
370 return;
371 }
372
373 this->onGpuDrawPath(path, fill);
374 }
375
364 void GrGpu::finalizeReservedVertices() { 376 void GrGpu::finalizeReservedVertices() {
365 SkASSERT(NULL != fVertexPool); 377 SkASSERT(NULL != fVertexPool);
366 fVertexPool->unlock(); 378 fVertexPool->unlock();
367 } 379 }
368 380
369 void GrGpu::finalizeReservedIndices() { 381 void GrGpu::finalizeReservedIndices() {
370 SkASSERT(NULL != fIndexPool); 382 SkASSERT(NULL != fIndexPool);
371 fIndexPool->unlock(); 383 fIndexPool->unlock();
372 } 384 }
373 385
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } 503 }
492 504
493 void GrGpu::releaseIndexArray() { 505 void GrGpu::releaseIndexArray() {
494 // if index source was array, we stowed data in the pool 506 // if index source was array, we stowed data in the pool
495 const GeometrySrcState& geoSrc = this->getGeomSrc(); 507 const GeometrySrcState& geoSrc = this->getGeomSrc();
496 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); 508 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc);
497 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); 509 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t);
498 fIndexPool->putBack(bytes); 510 fIndexPool->putBack(bytes);
499 --fIndexPoolUseCnt; 511 --fIndexPoolUseCnt;
500 } 512 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698