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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 } | 247 } |
248 unrefCopy.reset(tex); | 248 unrefCopy.reset(tex); |
249 } | 249 } |
250 const SkImageInfo info = bm.info(); | 250 const SkImageInfo info = bm.info(); |
251 return SkNEW_ARGS(SkImage_Gpu, (info.width(), info.height(), info.alphaT
ype(), | 251 return SkNEW_ARGS(SkImage_Gpu, (info.width(), info.height(), info.alphaT
ype(), |
252 tex, 0, SkSurface::kNo_Budgeted)); | 252 tex, 0, SkSurface::kNo_Budgeted)); |
253 } | 253 } |
254 #endif | 254 #endif |
255 | 255 |
256 // This will check for immutable (share or copy) | 256 // This will check for immutable (share or copy) |
257 return SkNewImageFromRasterBitmap(bm, false, nullptr, kUnlocked_SharedPixelR
efMode); | 257 return SkNewImageFromRasterBitmap(bm, nullptr, kUnlocked_SharedPixelRefMode)
; |
258 } | 258 } |
259 | 259 |
260 bool SkImage::asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const { | 260 bool SkImage::asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const { |
261 return as_IB(this)->onAsLegacyBitmap(bitmap, mode); | 261 return as_IB(this)->onAsLegacyBitmap(bitmap, mode); |
262 } | 262 } |
263 | 263 |
264 bool SkImage_Base::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) con
st { | 264 bool SkImage_Base::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) con
st { |
265 // As the base-class, all we can do is make a copy (regardless of mode). | 265 // As the base-class, all we can do is make a copy (regardless of mode). |
266 // Subclasses that want to be more optimal should override. | 266 // Subclasses that want to be more optimal should override. |
267 SkImageInfo info = SkImageInfo::MakeN32(this->width(), this->height(), | 267 SkImageInfo info = SkImageInfo::MakeN32(this->width(), this->height(), |
(...skipping 23 matching lines...) Expand all Loading... |
291 | 291 |
292 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { | 292 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { |
293 return NULL; | 293 return NULL; |
294 } | 294 } |
295 | 295 |
296 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { | 296 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { |
297 return NULL; | 297 return NULL; |
298 } | 298 } |
299 | 299 |
300 #endif | 300 #endif |
OLD | NEW |