OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkBitmapCache.h" | 9 #include "SkBitmapCache.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 504 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
505 #include "SkImageDeserializer.h" | 505 #include "SkImageDeserializer.h" |
506 | 506 |
507 sk_sp<SkImage> SkImageDeserializer::makeFromData(SkData* data, const SkIRect* su
bset) { | 507 sk_sp<SkImage> SkImageDeserializer::makeFromData(SkData* data, const SkIRect* su
bset) { |
508 return SkImage::MakeFromEncoded(sk_ref_sp(data), subset); | 508 return SkImage::MakeFromEncoded(sk_ref_sp(data), subset); |
509 } | 509 } |
510 sk_sp<SkImage> SkImageDeserializer::makeFromMemory(const void* data, size_t leng
th, | 510 sk_sp<SkImage> SkImageDeserializer::makeFromMemory(const void* data, size_t leng
th, |
511 const SkIRect* subset) { | 511 const SkIRect* subset) { |
512 return SkImage::MakeFromEncoded(SkData::MakeWithCopy(data, length), subset); | 512 return SkImage::MakeFromEncoded(SkData::MakeWithCopy(data, length), subset); |
513 } | 513 } |
| 514 |
| 515 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 516 |
| 517 void SkImage_pinAsTexture(const SkImage* image, GrContext* ctx) { |
| 518 SkASSERT(image); |
| 519 SkASSERT(ctx); |
| 520 as_IB(image)->onPinAsTexture(ctx); |
| 521 } |
| 522 |
| 523 void SkImage_unpinAsTexture(const SkImage* image, GrContext* ctx) { |
| 524 SkASSERT(image); |
| 525 SkASSERT(ctx); |
| 526 as_IB(image)->onUnpinAsTexture(ctx); |
| 527 } |
OLD | NEW |