| 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/GrTextureDomainEffect.h" | 10 #include "effects/GrTextureDomainEffect.h" |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |