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