| 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 "SkImage_Base.h" | 8 #include "SkImage_Base.h" |
| 9 #include "SkImagePriv.h" | 9 #include "SkImagePriv.h" |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 /////////////////////////////////////////////////////////////////////////////// | 87 /////////////////////////////////////////////////////////////////////////////// |
| 88 | 88 |
| 89 SkImage* SkNewImageFromBitmapTexture(const SkBitmap& bitmap, int sampleCountForN
ewSurfaces) { | 89 SkImage* SkNewImageFromBitmapTexture(const SkBitmap& bitmap, int sampleCountForN
ewSurfaces) { |
| 90 if (NULL == bitmap.getTexture()) { | 90 if (NULL == bitmap.getTexture()) { |
| 91 return NULL; | 91 return NULL; |
| 92 } | 92 } |
| 93 return SkNEW_ARGS(SkImage_Gpu, (bitmap, sampleCountForNewSurfaces)); | 93 return SkNEW_ARGS(SkImage_Gpu, (bitmap, sampleCountForNewSurfaces)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 SkImage* SkImage::NewTexture(const SkBitmap& bitmap) { | |
| 97 return SkNewImageFromBitmapTexture(bitmap, 0); | |
| 98 } | |
| 99 | |
| 100 GrTexture* SkTextureImageGetTexture(SkImage* image) { | 96 GrTexture* SkTextureImageGetTexture(SkImage* image) { |
| 101 return ((SkImage_Gpu*)image)->getTexture(); | 97 return ((SkImage_Gpu*)image)->getTexture(); |
| 102 } | 98 } |
| 103 | 99 |
| OLD | NEW |