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

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

Issue 278963002: add localmatrix parameter to shader's asNewEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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/effects/gradients/SkTwoPointRadialGradient.cpp ('k') | no next file » | 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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "effects/GrBicubicEffect.h" 10 #include "effects/GrBicubicEffect.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 SkShader* shader = skPaint.getShader(); 456 SkShader* shader = skPaint.getShader();
457 if (NULL == shader) { 457 if (NULL == shader) {
458 return skPaint2GrPaintNoShader(dev, skPaint, false, constantColor, grPai nt); 458 return skPaint2GrPaintNoShader(dev, skPaint, false, constantColor, grPai nt);
459 } 459 }
460 460
461 // SkShader::asNewEffect() may do offscreen rendering. Setup default drawing state and require 461 // SkShader::asNewEffect() may do offscreen rendering. Setup default drawing state and require
462 // the shader to set a render target . 462 // the shader to set a render target .
463 GrContext::AutoWideOpenIdentityDraw awo(dev->context(), NULL); 463 GrContext::AutoWideOpenIdentityDraw awo(dev->context(), NULL);
464 464
465 // setup the shader as the first color effect on the paint 465 // setup the shader as the first color effect on the paint
466 SkAutoTUnref<GrEffectRef> effect(shader->asNewEffect(dev->context(), skPaint )); 466 SkAutoTUnref<GrEffectRef> effect(shader->asNewEffect(dev->context(), skPaint , NULL));
467 if (NULL != effect.get()) { 467 if (NULL != effect.get()) {
468 grPaint->addColorEffect(effect); 468 grPaint->addColorEffect(effect);
469 // Now setup the rest of the paint. 469 // Now setup the rest of the paint.
470 return skPaint2GrPaintNoShader(dev, skPaint, true, false, grPaint); 470 return skPaint2GrPaintNoShader(dev, skPaint, true, false, grPaint);
471 } else { 471 } else {
472 // We still don't have SkColorShader::asNewEffect() implemented. 472 // We still don't have SkColorShader::asNewEffect() implemented.
473 SkShader::GradientInfo info; 473 SkShader::GradientInfo info;
474 SkColor color; 474 SkColor color;
475 475
476 info.fColors = &color; 476 info.fColors = &color;
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict ure, i); 2120 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict ure, i);
2121 2121
2122 if (NULL != layer->getTexture()) { 2122 if (NULL != layer->getTexture()) {
2123 fContext->unlockScratchTexture(layer->getTexture()); 2123 fContext->unlockScratchTexture(layer->getTexture());
2124 layer->setTexture(NULL); 2124 layer->setTexture(NULL);
2125 } 2125 }
2126 } 2126 }
2127 2127
2128 return true; 2128 return true;
2129 } 2129 }
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointRadialGradient.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698