Chromium Code Reviews| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 fLegacyBitmap.notifyPixelsChanged(); | 271 fLegacyBitmap.notifyPixelsChanged(); |
| 272 | 272 |
| 273 return true; | 273 return true; |
| 274 } | 274 } |
| 275 | 275 |
| 276 const SkBitmap& SkGpuDevice::onAccessBitmap() { | 276 const SkBitmap& SkGpuDevice::onAccessBitmap() { |
| 277 DO_DEFERRED_CLEAR(); | 277 DO_DEFERRED_CLEAR(); |
| 278 return fLegacyBitmap; | 278 return fLegacyBitmap; |
| 279 } | 279 } |
| 280 | 280 |
| 281 bool SkGpuDevice::onAccessPixels(SkPixmap* pmap) { | |
| 282 DO_DEFERRED_CLEAR(); | |
| 283 // For compatibility with clients the know we're backed w/ a bitmap, and wan t to inspect its | |
| 284 // genID. When we can hide/remove that fact, we can eliminate this call to n otify. | |
|
robertphillips
2015/06/09 18:17:37
erg
reed1
2015/06/09 18:34:10
Done.
| |
| 285 fLegacyBitmap.notifyPixelsChanged(); | |
| 286 return false; | |
| 287 } | |
| 288 | |
| 281 void SkGpuDevice::onAttachToCanvas(SkCanvas* canvas) { | 289 void SkGpuDevice::onAttachToCanvas(SkCanvas* canvas) { |
| 282 INHERITED::onAttachToCanvas(canvas); | 290 INHERITED::onAttachToCanvas(canvas); |
| 283 | 291 |
| 284 // Canvas promises that this ptr is valid until onDetachFromCanvas is called | 292 // Canvas promises that this ptr is valid until onDetachFromCanvas is called |
| 285 fClipStack.reset(SkRef(canvas->getClipStack())); | 293 fClipStack.reset(SkRef(canvas->getClipStack())); |
| 286 } | 294 } |
| 287 | 295 |
| 288 void SkGpuDevice::onDetachFromCanvas() { | 296 void SkGpuDevice::onDetachFromCanvas() { |
| 289 INHERITED::onDetachFromCanvas(); | 297 INHERITED::onDetachFromCanvas(); |
| 290 fClip.reset(); | 298 fClip.reset(); |
| (...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1781 #endif | 1789 #endif |
| 1782 } | 1790 } |
| 1783 | 1791 |
| 1784 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1792 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1785 // We always return a transient cache, so it is freed after each | 1793 // We always return a transient cache, so it is freed after each |
| 1786 // filter traversal. | 1794 // filter traversal. |
| 1787 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1795 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1788 } | 1796 } |
| 1789 | 1797 |
| 1790 #endif | 1798 #endif |
| OLD | NEW |