OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |