OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkAndroidSDKCanvas.h" | 8 #include "SkAndroidSDKCanvas.h" |
9 | 9 |
10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 return fProxyTarget->makeSurface(info, &props); | 293 return fProxyTarget->makeSurface(info, &props); |
294 } | 294 } |
295 | 295 |
296 bool SkAndroidSDKCanvas::onPeekPixels(SkPixmap* pmap) { | 296 bool SkAndroidSDKCanvas::onPeekPixels(SkPixmap* pmap) { |
297 return fProxyTarget->peekPixels(pmap); | 297 return fProxyTarget->peekPixels(pmap); |
298 } | 298 } |
299 | 299 |
300 bool SkAndroidSDKCanvas::onAccessTopLayerPixels(SkPixmap* pmap) { | 300 bool SkAndroidSDKCanvas::onAccessTopLayerPixels(SkPixmap* pmap) { |
301 SkASSERT(pmap); | 301 SkASSERT(pmap); |
302 SkImageInfo info; | 302 SkImageInfo info; |
303 size_t rowBytes; | 303 size_t rowBytes; |
304 const void* addr = fProxyTarget->accessTopLayerPixels(&info, &rowBytes, null
ptr); | 304 const void* addr = fProxyTarget->accessTopLayerPixels(&info, &rowBytes, null
ptr); |
305 if (addr) { | 305 if (addr) { |
306 pmap->reset(info, addr, rowBytes); | 306 pmap->reset(info, addr, rowBytes); |
307 return true; | 307 return true; |
308 } | 308 } |
309 return false; | 309 return false; |
310 } | 310 } |
311 | 311 |
312 void SkAndroidSDKCanvas::willSave() { | 312 void SkAndroidSDKCanvas::willSave() { |
313 fProxyTarget->save(); | 313 fProxyTarget->save(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 SkRegion::Op op, | 348 SkRegion::Op op, |
349 ClipEdgeStyle style) { | 349 ClipEdgeStyle style) { |
350 fProxyTarget->clipPath(path, op, style); | 350 fProxyTarget->clipPath(path, op, style); |
351 } | 351 } |
352 | 352 |
353 void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { | 353 void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { |
354 fProxyTarget->clipRegion(region, op); | 354 fProxyTarget->clipRegion(region, op); |
355 } | 355 } |
356 | 356 |
357 void SkAndroidSDKCanvas::onDiscard() { fProxyTarget->discard(); } | 357 void SkAndroidSDKCanvas::onDiscard() { fProxyTarget->discard(); } |
358 | |
359 | |
OLD | NEW |