| 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 offset->fX += outSubset->x(); | 380 offset->fX += outSubset->x(); |
| 381 offset->fY += outSubset->y(); | 381 offset->fY += outSubset->y(); |
| 382 // This isn't really a "tight" subset, but includes any texture padding. | 382 // This isn't really a "tight" subset, but includes any texture padding. |
| 383 return result->makeTightSubset(fullSize); | 383 return result->makeTightSubset(fullSize); |
| 384 } | 384 } |
| 385 | 385 |
| 386 bool SkImage::isLazyGenerated() const { | 386 bool SkImage::isLazyGenerated() const { |
| 387 return as_IB(this)->onIsLazyGenerated(); | 387 return as_IB(this)->onIsLazyGenerated(); |
| 388 } | 388 } |
| 389 | 389 |
| 390 void SkImage::pinAsTexture(GrContext* ctx) const { |
| 391 SkASSERT(ctx); |
| 392 as_IB(this)->onPinAsTexture(ctx); |
| 393 } |
| 394 |
| 395 void SkImage::unpinAsTexture(GrContext* ctx) const { |
| 396 SkASSERT(ctx); |
| 397 as_IB(this)->onUnpinAsTexture(ctx); |
| 398 } |
| 399 |
| 390 ////////////////////////////////////////////////////////////////////////////////
////// | 400 ////////////////////////////////////////////////////////////////////////////////
////// |
| 391 | 401 |
| 392 #if !SK_SUPPORT_GPU | 402 #if !SK_SUPPORT_GPU |
| 393 | 403 |
| 394 sk_sp<SkImage> SkImage::MakeTextureFromPixmap(GrContext*, const SkPixmap&, SkBud
geted budgeted) { | 404 sk_sp<SkImage> SkImage::MakeTextureFromPixmap(GrContext*, const SkPixmap&, SkBud
geted budgeted) { |
| 395 return nullptr; | 405 return nullptr; |
| 396 } | 406 } |
| 397 | 407 |
| 398 sk_sp<SkImage> SkImage::MakeFromTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType, | 408 sk_sp<SkImage> SkImage::MakeFromTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType, |
| 399 sk_sp<SkColorSpace>, TextureReleaseProc,
ReleaseContext) { | 409 sk_sp<SkColorSpace>, TextureReleaseProc,
ReleaseContext) { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 514 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 505 #include "SkImageDeserializer.h" | 515 #include "SkImageDeserializer.h" |
| 506 | 516 |
| 507 sk_sp<SkImage> SkImageDeserializer::makeFromData(SkData* data, const SkIRect* su
bset) { | 517 sk_sp<SkImage> SkImageDeserializer::makeFromData(SkData* data, const SkIRect* su
bset) { |
| 508 return SkImage::MakeFromEncoded(sk_ref_sp(data), subset); | 518 return SkImage::MakeFromEncoded(sk_ref_sp(data), subset); |
| 509 } | 519 } |
| 510 sk_sp<SkImage> SkImageDeserializer::makeFromMemory(const void* data, size_t leng
th, | 520 sk_sp<SkImage> SkImageDeserializer::makeFromMemory(const void* data, size_t leng
th, |
| 511 const SkIRect* subset) { | 521 const SkIRect* subset) { |
| 512 return SkImage::MakeFromEncoded(SkData::MakeWithCopy(data, length), subset); | 522 return SkImage::MakeFromEncoded(SkData::MakeWithCopy(data, length), subset); |
| 513 } | 523 } |
| OLD | NEW |