OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrSWMaskHelper.h" | 8 #include "GrSWMaskHelper.h" |
9 | 9 |
10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 return false; | 208 return false; |
209 } | 209 } |
210 fPixels.erase(0); | 210 fPixels.erase(0); |
211 } else { | 211 } else { |
212 // Otherwise, we just need to remember how big the buffer is... | 212 // Otherwise, we just need to remember how big the buffer is... |
213 fPixels.reset(bmImageInfo); | 213 fPixels.reset(bmImageInfo); |
214 } | 214 } |
215 fDraw.fDst = fPixels; | 215 fDraw.fDst = fPixels; |
216 fRasterClip.setRect(bounds); | 216 fRasterClip.setRect(bounds); |
217 fDraw.fRC = &fRasterClip; | 217 fDraw.fRC = &fRasterClip; |
218 fDraw.fClip = &fRasterClip.bwRgn(); | |
219 fDraw.fMatrix = &fMatrix; | 218 fDraw.fMatrix = &fMatrix; |
220 return true; | 219 return true; |
221 } | 220 } |
222 | 221 |
223 /** | 222 /** |
224 * Get a texture (from the texture cache) of the correct size & format. | 223 * Get a texture (from the texture cache) of the correct size & format. |
225 */ | 224 */ |
226 GrTexture* GrSWMaskHelper::createTexture() { | 225 GrTexture* GrSWMaskHelper::createTexture() { |
227 GrSurfaceDesc desc; | 226 GrSurfaceDesc desc; |
228 desc.fWidth = fPixels.width(); | 227 desc.fWidth = fPixels.width(); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 pipelineBuilder->addCoverageFragmentProcessor( | 356 pipelineBuilder->addCoverageFragmentProcessor( |
358 GrSimpleTextureEffect::Create(texture, | 357 GrSimpleTextureEffect::Create(texture, |
359 maskMatrix, | 358 maskMatrix, |
360 GrTextureParams::kNone_Fi
lterMode, | 359 GrTextureParams::kNone_Fi
lterMode, |
361 kDevice_GrCoordSet))->unr
ef(); | 360 kDevice_GrCoordSet))->unr
ef(); |
362 | 361 |
363 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S
kMatrix::I(), | 362 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S
kMatrix::I(), |
364 dstRect,
nullptr, &invert)); | 363 dstRect,
nullptr, &invert)); |
365 target->drawBatch(*pipelineBuilder, batch); | 364 target->drawBatch(*pipelineBuilder, batch); |
366 } | 365 } |
OLD | NEW |