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

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

Issue 133763006: Remove redundant auto rt object in skpaint2grpaintshader function. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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 | « no previous file | 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 // same meaning as in skPaint2GrPaintNoShader. 498 // same meaning as in skPaint2GrPaintNoShader.
499 inline bool skPaint2GrPaintShader(SkGpuDevice* dev, 499 inline bool skPaint2GrPaintShader(SkGpuDevice* dev,
500 const SkPaint& skPaint, 500 const SkPaint& skPaint,
501 bool constantColor, 501 bool constantColor,
502 GrPaint* grPaint) { 502 GrPaint* grPaint) {
503 SkShader* shader = skPaint.getShader(); 503 SkShader* shader = skPaint.getShader();
504 if (NULL == shader) { 504 if (NULL == shader) {
505 return skPaint2GrPaintNoShader(dev, skPaint, false, constantColor, grPai nt); 505 return skPaint2GrPaintNoShader(dev, skPaint, false, constantColor, grPai nt);
506 } 506 }
507 507
508 // SkShader::asNewEffect() may do offscreen rendering. Setup default drawing state 508 // SkShader::asNewEffect() may do offscreen rendering. Setup default drawing state and require
509 // Also require shader to set the render target . 509 // the shader to set a render target .
510 GrContext::AutoWideOpenIdentityDraw awo(dev->context(), NULL); 510 GrContext::AutoWideOpenIdentityDraw awo(dev->context(), NULL);
bsalomon 2014/01/13 14:47:10 this NULL param to awo() is the rt, so the art bel
511 GrContext::AutoRenderTarget(dev->context(), NULL);
512 511
513 // setup the shader as the first color effect on the paint 512 // setup the shader as the first color effect on the paint
514 SkAutoTUnref<GrEffectRef> effect(shader->asNewEffect(dev->context(), skPaint )); 513 SkAutoTUnref<GrEffectRef> effect(shader->asNewEffect(dev->context(), skPaint ));
515 if (NULL != effect.get()) { 514 if (NULL != effect.get()) {
516 grPaint->addColorEffect(effect); 515 grPaint->addColorEffect(effect);
517 // Now setup the rest of the paint. 516 // Now setup the rest of the paint.
518 return skPaint2GrPaintNoShader(dev, skPaint, true, false, grPaint); 517 return skPaint2GrPaintNoShader(dev, skPaint, true, false, grPaint);
519 } else { 518 } else {
520 // We still don't have SkColorShader::asNewEffect() implemented. 519 // We still don't have SkColorShader::asNewEffect() implemented.
521 SkShader::GradientInfo info; 520 SkShader::GradientInfo info;
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1921 GrTexture* texture, 1920 GrTexture* texture,
1922 bool needClear) 1921 bool needClear)
1923 : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) { 1922 : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) {
1924 1923
1925 SkASSERT(texture && texture->asRenderTarget()); 1924 SkASSERT(texture && texture->asRenderTarget());
1926 // This constructor is called from onCreateCompatibleDevice. It has locked t he RT in the texture 1925 // This constructor is called from onCreateCompatibleDevice. It has locked t he RT in the texture
1927 // cache. We pass true for the third argument so that it will get unlocked. 1926 // cache. We pass true for the third argument so that it will get unlocked.
1928 this->initFromRenderTarget(context, texture->asRenderTarget(), true); 1927 this->initFromRenderTarget(context, texture->asRenderTarget(), true);
1929 fNeedClear = needClear; 1928 fNeedClear = needClear;
1930 } 1929 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698