OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #ifndef SkImage_Gpu_DEFINED | 8 #ifndef SkImage_Gpu_DEFINED |
9 #define SkImage_Gpu_DEFINED | 9 #define SkImage_Gpu_DEFINED |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 bool getROPixels(SkBitmap*, CachingHint) const override; | 38 bool getROPixels(SkBitmap*, CachingHint) const override; |
39 GrTexture* asTextureRef(GrContext* ctx, const GrTextureParams& params) const
override; | 39 GrTexture* asTextureRef(GrContext* ctx, const GrTextureParams& params) const
override; |
40 SkImage* onNewSubset(const SkIRect&) const override; | 40 SkImage* onNewSubset(const SkIRect&) const override; |
41 | 41 |
42 GrTexture* peekTexture() const override { return fTexture; } | 42 GrTexture* peekTexture() const override { return fTexture; } |
43 bool isOpaque() const override; | 43 bool isOpaque() const override; |
44 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, | 44 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, |
45 int srcX, int srcY, CachingHint) const override; | 45 int srcX, int srcY, CachingHint) const override; |
46 SkImage* onApplyFilter(SkImageFilter*, SkIPoint* offset, | |
47 bool forceResultToOriginalSize) const override; | |
48 | 46 |
49 SkSurface* onNewSurface(const SkImageInfo& info) const override { | 47 SkSurface* onNewSurface(const SkImageInfo& info) const override { |
50 return SkSurface::NewRenderTarget(fTexture->getContext(), SkSurface::kNo
_Budgeted, info); | 48 return SkSurface::NewRenderTarget(fTexture->getContext(), SkSurface::kNo
_Budgeted, info); |
51 } | 49 } |
52 | 50 |
53 bool asBitmapForImageFilters(SkBitmap* bitmap) const override; | 51 bool asBitmapForImageFilters(SkBitmap* bitmap) const override; |
54 | 52 |
55 private: | 53 private: |
56 SkAutoTUnref<GrTexture> fTexture; | 54 SkAutoTUnref<GrTexture> fTexture; |
57 const SkAlphaType fAlphaType; | 55 const SkAlphaType fAlphaType; |
58 const SkSurface::Budgeted fBudgeted; | 56 const SkSurface::Budgeted fBudgeted; |
59 mutable SkAtomic<bool> fAddedRasterVersionToCache; | 57 mutable SkAtomic<bool> fAddedRasterVersionToCache; |
60 | 58 |
61 | 59 |
62 typedef SkImage_Base INHERITED; | 60 typedef SkImage_Base INHERITED; |
63 }; | 61 }; |
64 | 62 |
65 #endif | 63 #endif |
OLD | NEW |