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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 278 } |
279 | 279 |
280 /** | 280 /** |
281 * Move the result of the software mask generation back to the gpu | 281 * Move the result of the software mask generation back to the gpu |
282 */ | 282 */ |
283 void GrSWMaskHelper::toTexture(GrTexture *texture) { | 283 void GrSWMaskHelper::toTexture(GrTexture *texture) { |
284 GrSurfaceDesc desc; | 284 GrSurfaceDesc desc; |
285 desc.fWidth = fPixels.width(); | 285 desc.fWidth = fPixels.width(); |
286 desc.fHeight = fPixels.height(); | 286 desc.fHeight = fPixels.height(); |
287 desc.fConfig = texture->config(); | 287 desc.fConfig = texture->config(); |
288 | 288 |
289 // First see if we should compress this texture before uploading. | 289 // First see if we should compress this texture before uploading. |
290 switch (fCompressionMode) { | 290 switch (fCompressionMode) { |
291 case kNone_CompressionMode: | 291 case kNone_CompressionMode: |
292 this->sendTextureData(texture, desc, fPixels.addr(), fPixels.rowByte
s()); | 292 this->sendTextureData(texture, desc, fPixels.addr(), fPixels.rowByte
s()); |
293 break; | 293 break; |
294 | 294 |
295 case kCompress_CompressionMode: | 295 case kCompress_CompressionMode: |
296 this->compressTextureData(texture, desc); | 296 this->compressTextureData(texture, desc); |
297 break; | 297 break; |
298 | 298 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 pipelineBuilder->addCoverageFragmentProcessor( | 368 pipelineBuilder->addCoverageFragmentProcessor( |
369 GrSimpleTextureEffect::Create(texture, | 369 GrSimpleTextureEffect::Create(texture, |
370 maskMatrix, | 370 maskMatrix, |
371 GrTextureParams::kNone_Fi
lterMode, | 371 GrTextureParams::kNone_Fi
lterMode, |
372 kDevice_GrCoordSet))->unr
ef(); | 372 kDevice_GrCoordSet))->unr
ef(); |
373 | 373 |
374 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S
kMatrix::I(), | 374 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S
kMatrix::I(), |
375 dstRect,
nullptr, &invert)); | 375 dstRect,
nullptr, &invert)); |
376 target->drawBatch(*pipelineBuilder, batch); | 376 target->drawBatch(*pipelineBuilder, batch); |
377 } | 377 } |
OLD | NEW |