| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 void SkImage_Gpu::onDrawRectToRect(SkCanvas* canvas, const SkRect* src, const Sk
Rect& dst, | 52 void SkImage_Gpu::onDrawRectToRect(SkCanvas* canvas, const SkRect* src, const Sk
Rect& dst, |
| 53 const SkPaint* paint) { | 53 const SkPaint* paint) { |
| 54 canvas->drawBitmapRectToRect(fBitmap, src, dst, paint); | 54 canvas->drawBitmapRectToRect(fBitmap, src, dst, paint); |
| 55 } | 55 } |
| 56 | 56 |
| 57 GrTexture* SkImage_Gpu::onGetTexture() { | 57 GrTexture* SkImage_Gpu::onGetTexture() { |
| 58 return fBitmap.getTexture(); | 58 return fBitmap.getTexture(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool SkImage_Gpu::getROPixels(SkBitmap* dst) const { | 61 bool SkImage_Gpu::getROPixels(SkBitmap* dst) const { |
| 62 return fBitmap.copyTo(dst, kPMColor_SkColorType); | 62 return fBitmap.copyTo(dst, kN32_SkColorType); |
| 63 } | 63 } |
| 64 | 64 |
| 65 /////////////////////////////////////////////////////////////////////////////// | 65 /////////////////////////////////////////////////////////////////////////////// |
| 66 | 66 |
| 67 SkImage* SkImage::NewTexture(const SkBitmap& bitmap) { | 67 SkImage* SkImage::NewTexture(const SkBitmap& bitmap) { |
| 68 if (NULL == bitmap.getTexture()) { | 68 if (NULL == bitmap.getTexture()) { |
| 69 return NULL; | 69 return NULL; |
| 70 } | 70 } |
| 71 | 71 |
| 72 return SkNEW_ARGS(SkImage_Gpu, (bitmap)); | 72 return SkNEW_ARGS(SkImage_Gpu, (bitmap)); |
| 73 } | 73 } |
| 74 | 74 |
| 75 GrTexture* SkTextureImageGetTexture(SkImage* image) { | 75 GrTexture* SkTextureImageGetTexture(SkImage* image) { |
| 76 return ((SkImage_Gpu*)image)->getTexture(); | 76 return ((SkImage_Gpu*)image)->getTexture(); |
| 77 } | 77 } |
| OLD | NEW |