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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 285 |
286 bool SkAndroidSDKCanvas::isClipEmpty() const { return fProxyTarget->isClipEmpty(
); } | 286 bool SkAndroidSDKCanvas::isClipEmpty() const { return fProxyTarget->isClipEmpty(
); } |
287 bool SkAndroidSDKCanvas::isClipRect() const { return fProxyTarget->isClipRect();
} | 287 bool SkAndroidSDKCanvas::isClipRect() const { return fProxyTarget->isClipRect();
} |
288 | 288 |
289 SkSurface* SkAndroidSDKCanvas::onNewSurface(const SkImageInfo& info, | 289 SkSurface* SkAndroidSDKCanvas::onNewSurface(const SkImageInfo& info, |
290 const SkSurfaceProps& props
) { | 290 const SkSurfaceProps& props
) { |
291 return fProxyTarget->newSurface(info, &props); | 291 return fProxyTarget->newSurface(info, &props); |
292 } | 292 } |
293 | 293 |
294 bool SkAndroidSDKCanvas::onPeekPixels(SkPixmap* pmap) { | 294 bool SkAndroidSDKCanvas::onPeekPixels(SkPixmap* pmap) { |
295 SkASSERT(pmap); | 295 return fProxyTarget->peekPixels(pmap); |
296 SkImageInfo info; | |
297 size_t rowBytes; | |
298 const void* addr = fProxyTarget->peekPixels(&info, &rowBytes); | |
299 if (addr) { | |
300 pmap->reset(info, addr, rowBytes); | |
301 return true; | |
302 } | |
303 return false; | |
304 } | 296 } |
305 | 297 |
306 bool SkAndroidSDKCanvas::onAccessTopLayerPixels(SkPixmap* pmap) { | 298 bool SkAndroidSDKCanvas::onAccessTopLayerPixels(SkPixmap* pmap) { |
307 SkASSERT(pmap); | 299 SkASSERT(pmap); |
308 SkImageInfo info; | 300 SkImageInfo info; |
309 size_t rowBytes; | 301 size_t rowBytes; |
310 const void* addr = fProxyTarget->accessTopLayerPixels(&info, &rowBytes, null
ptr); | 302 const void* addr = fProxyTarget->accessTopLayerPixels(&info, &rowBytes, null
ptr); |
311 if (addr) { | 303 if (addr) { |
312 pmap->reset(info, addr, rowBytes); | 304 pmap->reset(info, addr, rowBytes); |
313 return true; | 305 return true; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 fProxyTarget->clipPath(path, op, style); | 348 fProxyTarget->clipPath(path, op, style); |
357 } | 349 } |
358 | 350 |
359 void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { | 351 void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { |
360 fProxyTarget->clipRegion(region, op); | 352 fProxyTarget->clipRegion(region, op); |
361 } | 353 } |
362 | 354 |
363 void SkAndroidSDKCanvas::onDiscard() { fProxyTarget->discard(); } | 355 void SkAndroidSDKCanvas::onDiscard() { fProxyTarget->discard(); } |
364 | 356 |
365 | 357 |
OLD | NEW |