| 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 "GrPipelineBuilder.h" | 10 #include "GrPipelineBuilder.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 int dimX, dimY; | 241 int dimX, dimY; |
| 242 SkTextureCompressor::GetBlockDimensions(fCompressedFormat, &dimX, &dimY)
; | 242 SkTextureCompressor::GetBlockDimensions(fCompressedFormat, &dimX, &dimY)
; |
| 243 SkASSERT((desc.fWidth % dimX) == 0); | 243 SkASSERT((desc.fWidth % dimX) == 0); |
| 244 SkASSERT((desc.fHeight % dimY) == 0); | 244 SkASSERT((desc.fHeight % dimY) == 0); |
| 245 #endif | 245 #endif |
| 246 | 246 |
| 247 desc.fConfig = fmt_to_config(fCompressedFormat); | 247 desc.fConfig = fmt_to_config(fCompressedFormat); |
| 248 SkASSERT(fContext->getGpu()->caps()->isConfigTexturable(desc.fConfig)); | 248 SkASSERT(fContext->getGpu()->caps()->isConfigTexturable(desc.fConfig)); |
| 249 } | 249 } |
| 250 | 250 |
| 251 return fContext->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch)
; | 251 return fContext->textureProvider()->refScratchTexture( |
| 252 desc, GrTextureProvider::kApprox_ScratchTexMatch); |
| 252 } | 253 } |
| 253 | 254 |
| 254 void GrSWMaskHelper::sendTextureData(GrTexture *texture, const GrSurfaceDesc& de
sc, | 255 void GrSWMaskHelper::sendTextureData(GrTexture *texture, const GrSurfaceDesc& de
sc, |
| 255 const void *data, size_t rowbytes) { | 256 const void *data, size_t rowbytes) { |
| 256 // If we aren't reusing scratch textures we don't need to flush before | 257 // If we aren't reusing scratch textures we don't need to flush before |
| 257 // writing since no one else will be using 'texture' | 258 // writing since no one else will be using 'texture' |
| 258 bool reuseScratch = fContext->getGpu()->caps()->reuseScratchTextures(); | 259 bool reuseScratch = fContext->getGpu()->caps()->reuseScratchTextures(); |
| 259 | 260 |
| 260 // Since we're uploading to it, and it's compressed, 'texture' shouldn't | 261 // Since we're uploading to it, and it's compressed, 'texture' shouldn't |
| 261 // have a render target. | 262 // have a render target. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop
)); | 371 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop
)); |
| 371 | 372 |
| 372 pipelineBuilder->addCoverageProcessor( | 373 pipelineBuilder->addCoverageProcessor( |
| 373 GrSimpleTextureEffect::Create(texture, | 374 GrSimpleTextureEffect::Create(texture, |
| 374 maskMatrix, | 375 maskMatrix, |
| 375 GrTextureParams::kNone_Fi
lterMode, | 376 GrTextureParams::kNone_Fi
lterMode, |
| 376 kDevice_GrCoordSet))->unr
ef(); | 377 kDevice_GrCoordSet))->unr
ef(); |
| 377 | 378 |
| 378 target->drawRect(pipelineBuilder, color, SkMatrix::I(), dstRect, NULL, &inve
rt); | 379 target->drawRect(pipelineBuilder, color, SkMatrix::I(), dstRect, NULL, &inve
rt); |
| 379 } | 380 } |
| OLD | NEW |