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 | |
121 SkBitmapProcShader::BitmapProcShaderContext::BitmapProcShaderContext( | 115 SkBitmapProcShader::BitmapProcShaderContext::BitmapProcShaderContext( |
122 const SkBitmapProcShader& shader, const ContextRec& rec, SkBitmapProcSta
te* state) | 116 const SkBitmapProcShader& shader, const ContextRec& rec, SkBitmapProcSta
te* state) |
123 : INHERITED(shader, rec) | 117 : INHERITED(shader, rec) |
124 , fState(state) | 118 , fState(state) |
125 { | 119 { |
126 const SkBitmap& bitmap = *fState->fBitmap; | 120 const SkBitmap& bitmap = *fState->fBitmap; |
127 bool bitmapIsOpaque = bitmap.isOpaque(); | 121 bool bitmapIsOpaque = bitmap.isOpaque(); |
128 | 122 |
129 // update fFlags | 123 // update fFlags |
130 uint32_t flags = 0; | 124 uint32_t flags = 0; |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 #else | 455 #else |
462 | 456 |
463 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix&, | 457 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix&, |
464 const SkMatrix*, GrColor*, | 458 const SkMatrix*, GrColor*, |
465 GrFragmentProcessor**) const { | 459 GrFragmentProcessor**) const { |
466 SkDEBUGFAIL("Should not call in GPU-less build"); | 460 SkDEBUGFAIL("Should not call in GPU-less build"); |
467 return false; | 461 return false; |
468 } | 462 } |
469 | 463 |
470 #endif | 464 #endif |
OLD | NEW |