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 "SkColorPriv.h" | 8 #include "SkColorPriv.h" |
9 #include "SkReadBuffer.h" | 9 #include "SkReadBuffer.h" |
10 #include "SkWriteBuffer.h" | 10 #include "SkWriteBuffer.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 return SkNEW_PLACEMENT_ARGS(storage, BitmapProcShaderContext, (*this, rec, s
tate)); | 106 return SkNEW_PLACEMENT_ARGS(storage, BitmapProcShaderContext, (*this, rec, s
tate)); |
107 } | 107 } |
108 | 108 |
109 size_t SkBitmapProcShader::contextSize() const { | 109 size_t SkBitmapProcShader::contextSize() const { |
110 // The SkBitmapProcState is stored outside of the context object, with the c
ontext holding | 110 // The SkBitmapProcState is stored outside of the context object, with the c
ontext holding |
111 // a pointer to it. | 111 // a pointer to it. |
112 return sizeof(BitmapProcShaderContext) + sizeof(SkBitmapProcState); | 112 return sizeof(BitmapProcShaderContext) + sizeof(SkBitmapProcState); |
113 } | 113 } |
114 | 114 |
| 115 void SkBitmapProcShader::onPreroll() const { |
| 116 SkBitmap bm(fRawBitmap); |
| 117 bm.lockPixels(); |
| 118 bm.unlockPixels(); |
| 119 } |
| 120 |
115 SkBitmapProcShader::BitmapProcShaderContext::BitmapProcShaderContext( | 121 SkBitmapProcShader::BitmapProcShaderContext::BitmapProcShaderContext( |
116 const SkBitmapProcShader& shader, const ContextRec& rec, SkBitmapProcSta
te* state) | 122 const SkBitmapProcShader& shader, const ContextRec& rec, SkBitmapProcSta
te* state) |
117 : INHERITED(shader, rec) | 123 : INHERITED(shader, rec) |
118 , fState(state) | 124 , fState(state) |
119 { | 125 { |
120 const SkBitmap& bitmap = *fState->fBitmap; | 126 const SkBitmap& bitmap = *fState->fBitmap; |
121 bool bitmapIsOpaque = bitmap.isOpaque(); | 127 bool bitmapIsOpaque = bitmap.isOpaque(); |
122 | 128 |
123 // update fFlags | 129 // update fFlags |
124 uint32_t flags = 0; | 130 uint32_t flags = 0; |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 #else | 461 #else |
456 | 462 |
457 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix&, | 463 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix&, |
458 const SkMatrix*, GrColor*, | 464 const SkMatrix*, GrColor*, |
459 GrFragmentProcessor**) const { | 465 GrFragmentProcessor**) const { |
460 SkDEBUGFAIL("Should not call in GPU-less build"); | 466 SkDEBUGFAIL("Should not call in GPU-less build"); |
461 return false; | 467 return false; |
462 } | 468 } |
463 | 469 |
464 #endif | 470 #endif |
OLD | NEW |