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

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

Issue 31853003: Remove GrContext from SkXfermode::[Aa]sNewEffectOrCoeff() and all subclasses, (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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/SkXfermodeImageFilter.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/GrTextureDomainEffect.h" 10 #include "effects/GrTextureDomainEffect.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 GrPaint* grPaint) { 429 GrPaint* grPaint) {
430 430
431 grPaint->setDither(skPaint.isDither()); 431 grPaint->setDither(skPaint.isDither());
432 grPaint->setAntiAlias(skPaint.isAntiAlias()); 432 grPaint->setAntiAlias(skPaint.isAntiAlias());
433 433
434 SkXfermode::Coeff sm; 434 SkXfermode::Coeff sm;
435 SkXfermode::Coeff dm; 435 SkXfermode::Coeff dm;
436 436
437 SkXfermode* mode = skPaint.getXfermode(); 437 SkXfermode* mode = skPaint.getXfermode();
438 GrEffectRef* xferEffect = NULL; 438 GrEffectRef* xferEffect = NULL;
439 if (SkXfermode::AsNewEffectOrCoeff(mode, dev->context(), &xferEffect, &sm, & dm)) { 439 if (SkXfermode::AsNewEffectOrCoeff(mode, &xferEffect, &sm, &dm)) {
440 if (NULL != xferEffect) { 440 if (NULL != xferEffect) {
441 grPaint->addColorEffect(xferEffect)->unref(); 441 grPaint->addColorEffect(xferEffect)->unref();
442 sm = SkXfermode::kOne_Coeff; 442 sm = SkXfermode::kOne_Coeff;
443 dm = SkXfermode::kZero_Coeff; 443 dm = SkXfermode::kZero_Coeff;
444 } 444 }
445 } else { 445 } else {
446 //SkDEBUGCODE(SkDebugf("Unsupported xfer mode.\n");) 446 //SkDEBUGCODE(SkDebugf("Unsupported xfer mode.\n");)
447 #if 0 447 #if 0
448 return false; 448 return false;
449 #else 449 #else
(...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 GrTexture* texture, 1847 GrTexture* texture,
1848 bool needClear) 1848 bool needClear)
1849 : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) { 1849 : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) {
1850 1850
1851 SkASSERT(texture && texture->asRenderTarget()); 1851 SkASSERT(texture && texture->asRenderTarget());
1852 // This constructor is called from onCreateCompatibleDevice. It has locked t he RT in the texture 1852 // This constructor is called from onCreateCompatibleDevice. It has locked t he RT in the texture
1853 // cache. We pass true for the third argument so that it will get unlocked. 1853 // cache. We pass true for the third argument so that it will get unlocked.
1854 this->initFromRenderTarget(context, texture->asRenderTarget(), true); 1854 this->initFromRenderTarget(context, texture->asRenderTarget(), true);
1855 fNeedClear = needClear; 1855 fNeedClear = needClear;
1856 } 1856 }
OLDNEW
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698