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

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

Issue 13314002: Add support for reading the dst pixel value in an effect. Use in a new effect for the kDarken xfer … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fix some of the linter's nits Created 7 years, 8 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 GrCrash("Can't get vertices into buffer!"); 323 GrCrash("Can't get vertices into buffer!");
324 } 324 }
325 } 325 }
326 } 326 }
327 327
328 return fUnitSquareVertexBuffer; 328 return fUnitSquareVertexBuffer;
329 } 329 }
330 330
331 //////////////////////////////////////////////////////////////////////////////// 331 ////////////////////////////////////////////////////////////////////////////////
332 332
333 bool GrGpu::setupClipAndFlushState(DrawType type) { 333 bool GrGpu::setupClipAndFlushState(DrawType type, const GrDeviceCoordTexture* ds tCopy) {
334 334
335 if (!fClipMaskManager.setupClipping(this->getClip())) { 335 if (!fClipMaskManager.setupClipping(this->getClip())) {
336 return false; 336 return false;
337 } 337 }
338 338
339 if (!this->flushGraphicsState(type)) { 339 if (!this->flushGraphicsState(type, dstCopy)) {
340 return false; 340 return false;
341 } 341 }
342 342
343 return true; 343 return true;
344 } 344 }
345 345
346 //////////////////////////////////////////////////////////////////////////////// 346 ////////////////////////////////////////////////////////////////////////////////
347 347
348 void GrGpu::geometrySourceWillPush() { 348 void GrGpu::geometrySourceWillPush() {
349 const GeometrySrcState& geoSrc = this->getGeomSrc(); 349 const GeometrySrcState& geoSrc = this->getGeomSrc();
(...skipping 17 matching lines...) Expand all
367 } 367 }
368 368
369 void GrGpu::geometrySourceWillPop(const GeometrySrcState& restoredState) { 369 void GrGpu::geometrySourceWillPop(const GeometrySrcState& restoredState) {
370 // if popping last entry then pops are unbalanced with pushes 370 // if popping last entry then pops are unbalanced with pushes
371 GrAssert(fGeomPoolStateStack.count() > 1); 371 GrAssert(fGeomPoolStateStack.count() > 1);
372 fGeomPoolStateStack.pop_back(); 372 fGeomPoolStateStack.pop_back();
373 } 373 }
374 374
375 void GrGpu::onDraw(const DrawInfo& info) { 375 void GrGpu::onDraw(const DrawInfo& info) {
376 this->handleDirtyContext(); 376 this->handleDirtyContext();
377 if (!this->setupClipAndFlushState(PrimTypeToDrawType(info.primitiveType()))) { 377 if (!this->setupClipAndFlushState(PrimTypeToDrawType(info.primitiveType()), info.dstCopy())) {
378 return; 378 return;
379 } 379 }
380 this->onGpuDraw(info); 380 this->onGpuDraw(info);
381 } 381 }
382 382
383 void GrGpu::onStencilPath(const GrPath* path, const SkStrokeRec&, SkPath::FillTy pe fill) { 383 void GrGpu::onStencilPath(const GrPath* path, const SkStrokeRec&, SkPath::FillTy pe fill) {
384 this->handleDirtyContext(); 384 this->handleDirtyContext();
385 385
386 // TODO: make this more efficient (don't copy and copy back) 386 // TODO: make this more efficient (don't copy and copy back)
387 GrAutoTRestore<GrStencilSettings> asr(this->drawState()->stencil()); 387 GrAutoTRestore<GrStencilSettings> asr(this->drawState()->stencil());
388 388
389 this->setStencilPathSettings(*path, fill, this->drawState()->stencil()); 389 this->setStencilPathSettings(*path, fill, this->drawState()->stencil());
390 if (!this->setupClipAndFlushState(kStencilPath_DrawType)) { 390 if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL)) {
391 return; 391 return;
392 } 392 }
393 393
394 this->onGpuStencilPath(path, fill); 394 this->onGpuStencilPath(path, fill);
395 } 395 }
396 396
397 void GrGpu::finalizeReservedVertices() { 397 void GrGpu::finalizeReservedVertices() {
398 GrAssert(NULL != fVertexPool); 398 GrAssert(NULL != fVertexPool);
399 fVertexPool->unlock(); 399 fVertexPool->unlock();
400 } 400 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } 524 }
525 525
526 void GrGpu::releaseIndexArray() { 526 void GrGpu::releaseIndexArray() {
527 // if index source was array, we stowed data in the pool 527 // if index source was array, we stowed data in the pool
528 const GeometrySrcState& geoSrc = this->getGeomSrc(); 528 const GeometrySrcState& geoSrc = this->getGeomSrc();
529 GrAssert(kArray_GeometrySrcType == geoSrc.fIndexSrc); 529 GrAssert(kArray_GeometrySrcType == geoSrc.fIndexSrc);
530 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); 530 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t);
531 fIndexPool->putBack(bytes); 531 fIndexPool->putBack(bytes);
532 --fIndexPoolUseCnt; 532 --fIndexPoolUseCnt;
533 } 533 }
OLDNEW
« src/gpu/GrGpu.h ('K') | « src/gpu/GrGpu.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698