OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
9 | 9 |
10 #include "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 328 |
329 if (shouldRetainContent) { | 329 if (shouldRetainContent) { |
330 if (fRenderTarget->wasDestroyed()) { | 330 if (fRenderTarget->wasDestroyed()) { |
331 return; | 331 return; |
332 } | 332 } |
333 this->context()->copySurface(newRT, fRenderTarget); | 333 this->context()->copySurface(newRT, fRenderTarget); |
334 } | 334 } |
335 | 335 |
336 SkASSERT(fRenderTarget != newRT); | 336 SkASSERT(fRenderTarget != newRT); |
337 | 337 |
338 fRenderTarget.reset(newRT.detach()); | 338 fRenderTarget.reset(newRT.release()); |
339 | 339 |
340 #ifdef SK_DEBUG | 340 #ifdef SK_DEBUG |
341 SkImageInfo info = fRenderTarget->surfacePriv().info(fOpaque ? kOpaque_SkAlp
haType : | 341 SkImageInfo info = fRenderTarget->surfacePriv().info(fOpaque ? kOpaque_SkAlp
haType : |
342 kPremul_SkAlp
haType); | 342 kPremul_SkAlp
haType); |
343 SkASSERT(info == fLegacyBitmap.info()); | 343 SkASSERT(info == fLegacyBitmap.info()); |
344 #endif | 344 #endif |
345 SkPixelRef* pr = new SkGrPixelRef(fLegacyBitmap.info(), fRenderTarget); | 345 SkPixelRef* pr = new SkGrPixelRef(fLegacyBitmap.info(), fRenderTarget); |
346 fLegacyBitmap.setPixelRef(pr)->unref(); | 346 fLegacyBitmap.setPixelRef(pr)->unref(); |
347 | 347 |
348 fDrawContext.reset(this->context()->drawContext(fRenderTarget, &this->surfac
eProps())); | 348 fDrawContext.reset(this->context()->drawContext(fRenderTarget, &this->surfac
eProps())); |
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 } | 1878 } |
1879 | 1879 |
1880 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1880 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1881 ASSERT_SINGLE_OWNER | 1881 ASSERT_SINGLE_OWNER |
1882 // We always return a transient cache, so it is freed after each | 1882 // We always return a transient cache, so it is freed after each |
1883 // filter traversal. | 1883 // filter traversal. |
1884 return SkGpuDevice::NewImageFilterCache(); | 1884 return SkGpuDevice::NewImageFilterCache(); |
1885 } | 1885 } |
1886 | 1886 |
1887 #endif | 1887 #endif |
OLD | NEW |