| 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkData.h" | 10 #include "SkData.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 SkAutoTUnref<GrTexture> unrefCopy; | 240 SkAutoTUnref<GrTexture> unrefCopy; |
| 241 if (!bm.isImmutable()) { | 241 if (!bm.isImmutable()) { |
| 242 const bool notBudgeted = false; | 242 const bool notBudgeted = false; |
| 243 tex = GrDeepCopyTexture(tex, notBudgeted); | 243 tex = GrDeepCopyTexture(tex, notBudgeted); |
| 244 if (NULL == tex) { | 244 if (NULL == tex) { |
| 245 return NULL; | 245 return NULL; |
| 246 } | 246 } |
| 247 unrefCopy.reset(tex); | 247 unrefCopy.reset(tex); |
| 248 } | 248 } |
| 249 const SkImageInfo info = bm.info(); | 249 const SkImageInfo info = bm.info(); |
| 250 return SkNEW_ARGS(SkImage_Gpu, (info.width(), info.height(), bm.getGener
ationID(), | 250 return new SkImage_Gpu(info.width(), info.height(), bm.getGenerationID()
, info.alphaType(), |
| 251 info.alphaType(), tex, 0, SkSurface::kNo
_Budgeted)); | 251 tex, 0, SkSurface::kNo_Budgeted); |
| 252 } | 252 } |
| 253 #endif | 253 #endif |
| 254 | 254 |
| 255 // This will check for immutable (share or copy) | 255 // This will check for immutable (share or copy) |
| 256 return SkNewImageFromRasterBitmap(bm, nullptr); | 256 return SkNewImageFromRasterBitmap(bm, nullptr); |
| 257 } | 257 } |
| 258 | 258 |
| 259 bool SkImage::asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const { | 259 bool SkImage::asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const { |
| 260 return as_IB(this)->onAsLegacyBitmap(bitmap, mode); | 260 return as_IB(this)->onAsLegacyBitmap(bitmap, mode); |
| 261 } | 261 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { | 303 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { |
| 304 return NULL; | 304 return NULL; |
| 305 } | 305 } |
| 306 | 306 |
| 307 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { | 307 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { |
| 308 return NULL; | 308 return NULL; |
| 309 } | 309 } |
| 310 | 310 |
| 311 #endif | 311 #endif |
| OLD | NEW |