| 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 27 matching lines...) Expand all Loading... |
| 38 if (gShouldDrawProc && !gShouldDrawProc()) return; \ | 38 if (gShouldDrawProc && !gShouldDrawProc()) return; \ |
| 39 this->prepareDraw(draw, forceI); \ | 39 this->prepareDraw(draw, forceI); \ |
| 40 } while (0) | 40 } while (0) |
| 41 #else | 41 #else |
| 42 #define CHECK_SHOULD_DRAW(draw, forceI) this->prepareDraw(draw, forceI) | 42 #define CHECK_SHOULD_DRAW(draw, forceI) this->prepareDraw(draw, forceI) |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 // This constant represents the screen alignment criterion in texels for | 45 // This constant represents the screen alignment criterion in texels for |
| 46 // requiring texture domain clamping to prevent color bleeding when drawing | 46 // requiring texture domain clamping to prevent color bleeding when drawing |
| 47 // a sub region of a larger source image. | 47 // a sub region of a larger source image. |
| 48 #define COLOR_BLEED_TOLERANCE SkFloatToScalar(0.001f) | 48 #define COLOR_BLEED_TOLERANCE 0.001f |
| 49 | 49 |
| 50 #define DO_DEFERRED_CLEAR() \ | 50 #define DO_DEFERRED_CLEAR() \ |
| 51 do { \ | 51 do { \ |
| 52 if (fNeedClear) { \ | 52 if (fNeedClear) { \ |
| 53 this->clear(SK_ColorTRANSPARENT); \ | 53 this->clear(SK_ColorTRANSPARENT); \ |
| 54 } \ | 54 } \ |
| 55 } while (false) \ | 55 } while (false) \ |
| 56 | 56 |
| 57 /////////////////////////////////////////////////////////////////////////////// | 57 /////////////////////////////////////////////////////////////////////////////// |
| 58 | 58 |
| (...skipping 1788 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 |