| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SkBitmapProcShader.h" | 8 #include "SkBitmapProcShader.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkFlattenableBuffers.h" | 10 #include "SkFlattenableBuffers.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 flags |= kConstInY16_Flag; | 135 flags |= kConstInY16_Flag; |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 | 138 |
| 139 fFlags = flags; | 139 fFlags = flags; |
| 140 return true; | 140 return true; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void SkBitmapProcShader::endContext() { | 143 void SkBitmapProcShader::endContext() { |
| 144 fState.fOrigBitmap.unlockPixels(); | 144 fState.fOrigBitmap.unlockPixels(); |
| 145 fState.endContext(); |
| 145 this->INHERITED::endContext(); | 146 this->INHERITED::endContext(); |
| 146 } | 147 } |
| 147 | 148 |
| 148 #define BUF_MAX 128 | 149 #define BUF_MAX 128 |
| 149 | 150 |
| 150 #define TEST_BUFFER_OVERRITEx | 151 #define TEST_BUFFER_OVERRITEx |
| 151 | 152 |
| 152 #ifdef TEST_BUFFER_OVERRITE | 153 #ifdef TEST_BUFFER_OVERRITE |
| 153 #define TEST_BUFFER_EXTRA 32 | 154 #define TEST_BUFFER_EXTRA 32 |
| 154 #define TEST_PATTERN 0x88888888 | 155 #define TEST_PATTERN 0x88888888 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 if (NULL == texture) { | 359 if (NULL == texture) { |
| 359 SkDebugf("Couldn't convert bitmap to texture.\n"); | 360 SkDebugf("Couldn't convert bitmap to texture.\n"); |
| 360 return NULL; | 361 return NULL; |
| 361 } | 362 } |
| 362 | 363 |
| 363 GrEffectRef* effect = GrSimpleTextureEffect::Create(texture, matrix, params)
; | 364 GrEffectRef* effect = GrSimpleTextureEffect::Create(texture, matrix, params)
; |
| 364 GrUnlockAndUnrefCachedBitmapTexture(texture); | 365 GrUnlockAndUnrefCachedBitmapTexture(texture); |
| 365 return effect; | 366 return effect; |
| 366 } | 367 } |
| 367 #endif | 368 #endif |
| OLD | NEW |