OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 "SkImageFilter.h" | 8 #include "SkImageFilter.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 SkRect srcRect = SkRect::Make(bounds); | 311 SkRect srcRect = SkRect::Make(bounds); |
312 SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height()); | 312 SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height()); |
313 GrContext* context = srcTexture->getContext(); | 313 GrContext* context = srcTexture->getContext(); |
314 | 314 |
315 GrSurfaceDesc desc; | 315 GrSurfaceDesc desc; |
316 desc.fFlags = kRenderTarget_GrSurfaceFlag, | 316 desc.fFlags = kRenderTarget_GrSurfaceFlag, |
317 desc.fWidth = bounds.width(); | 317 desc.fWidth = bounds.width(); |
318 desc.fHeight = bounds.height(); | 318 desc.fHeight = bounds.height(); |
319 desc.fConfig = kRGBA_8888_GrPixelConfig; | 319 desc.fConfig = kRGBA_8888_GrPixelConfig; |
320 | 320 |
321 SkAutoTUnref<GrTexture> dst(context->textureProvider()->refScratchTexture( | 321 SkAutoTUnref<GrTexture> dst(context->textureProvider()->createApproxTexture(
desc)); |
322 desc, GrTextureProvider::kApprox_ScratchTexMatch)); | |
323 if (!dst) { | 322 if (!dst) { |
324 return false; | 323 return false; |
325 } | 324 } |
326 | 325 |
327 // setup new clip | 326 // setup new clip |
328 GrClip clip(dstRect); | 327 GrClip clip(dstRect); |
329 | 328 |
330 GrFragmentProcessor* fp; | 329 GrFragmentProcessor* fp; |
331 offset->fX = bounds.left(); | 330 offset->fX = bounds.left(); |
332 offset->fY = bounds.top(); | 331 offset->fY = bounds.top(); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 } | 578 } |
580 return dev; | 579 return dev; |
581 } | 580 } |
582 | 581 |
583 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm
ap& src, | 582 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm
ap& src, |
584 const SkImageFilter::Context& ctx, | 583 const SkImageFilter::Context& ctx, |
585 SkBitmap* result, SkIPoint* offset) { | 584 SkBitmap* result, SkIPoint* offset) { |
586 return fDevice->filterImage(filter, src, ctx, result, offset); | 585 return fDevice->filterImage(filter, src, ctx, result, offset); |
587 } | 586 } |
588 | 587 |
OLD | NEW |