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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 } | 302 } |
303 | 303 |
304 SkImageFilter::Cache* SkImageFilter::GetExternalCache() { | 304 SkImageFilter::Cache* SkImageFilter::GetExternalCache() { |
305 return gExternalCache; | 305 return gExternalCache; |
306 } | 306 } |
307 | 307 |
308 #if SK_SUPPORT_GPU | 308 #if SK_SUPPORT_GPU |
309 | 309 |
310 void SkImageFilter::WrapTexture(GrTexture* texture, int width, int height, SkBit
map* result) { | 310 void SkImageFilter::WrapTexture(GrTexture* texture, int width, int height, SkBit
map* result) { |
311 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); | 311 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); |
312 result->setConfig(info); | 312 result->setInfo(info); |
313 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); | 313 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); |
314 } | 314 } |
315 | 315 |
316 bool SkImageFilter::getInputResultGPU(SkImageFilter::Proxy* proxy, | 316 bool SkImageFilter::getInputResultGPU(SkImageFilter::Proxy* proxy, |
317 const SkBitmap& src, const Context& ctx, | 317 const SkBitmap& src, const Context& ctx, |
318 SkBitmap* result, SkIPoint* offset) const
{ | 318 SkBitmap* result, SkIPoint* offset) const
{ |
319 // Ensure that GrContext calls under filterImage and filterImageGPU below wi
ll see an identity | 319 // Ensure that GrContext calls under filterImage and filterImageGPU below wi
ll see an identity |
320 // matrix with no clip and that the matrix, clip, and render target set befo
re this function was | 320 // matrix with no clip and that the matrix, clip, and render target set befo
re this function was |
321 // called are restored before we return to the caller. | 321 // called are restored before we return to the caller. |
322 GrContext* context = src.getTexture()->getContext(); | 322 GrContext* context = src.getTexture()->getContext(); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 423 |
424 CacheImpl::~CacheImpl() { | 424 CacheImpl::~CacheImpl() { |
425 SkTDynamicHash<Value, Key>::Iter iter(&fData); | 425 SkTDynamicHash<Value, Key>::Iter iter(&fData); |
426 | 426 |
427 while (!iter.done()) { | 427 while (!iter.done()) { |
428 Value* v = &*iter; | 428 Value* v = &*iter; |
429 ++iter; | 429 ++iter; |
430 delete v; | 430 delete v; |
431 } | 431 } |
432 } | 432 } |
OLD | NEW |