OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 SkSpecialImage_DEFINED | 8 #ifndef SkSpecialImage_DEFINED |
9 #define SkSpecialImage_DEFINED | 9 #define SkSpecialImage_DEFINED |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 * Note: the contents of the backing storage outside of the subset rect are unde
fined. | 30 * Note: the contents of the backing storage outside of the subset rect are unde
fined. |
31 */ | 31 */ |
32 class SkSpecialImage : public SkRefCnt { | 32 class SkSpecialImage : public SkRefCnt { |
33 public: | 33 public: |
34 int width() const { return fSubset.width(); } | 34 int width() const { return fSubset.width(); } |
35 int height() const { return fSubset.height(); } | 35 int height() const { return fSubset.height(); } |
36 | 36 |
37 /** | 37 /** |
38 * Draw this SpecialImage into the canvas. | 38 * Draw this SpecialImage into the canvas. |
39 */ | 39 */ |
40 void draw(SkCanvas*, int x, int y, const SkPaint*) const; | 40 void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const; |
41 | 41 |
42 static SkSpecialImage* NewFromImage(const SkIRect& subset, const SkImage*); | 42 static SkSpecialImage* NewFromImage(const SkIRect& subset, const SkImage*); |
43 static SkSpecialImage* NewFromRaster(const SkIRect& subset, const SkBitmap&)
; | 43 static SkSpecialImage* NewFromRaster(const SkIRect& subset, const SkBitmap&)
; |
44 static SkSpecialImage* NewFromGpu(const SkIRect& subset, GrTexture*); | 44 static SkSpecialImage* NewFromGpu(const SkIRect& subset, GrTexture*); |
45 | 45 |
46 /** | 46 /** |
47 * Create a new surface with a backend that is compatible with this image. | 47 * Create a new surface with a backend that is compatible with this image. |
48 */ | 48 */ |
49 SkSpecialSurface* newSurface(const SkImageInfo&) const; | 49 SkSpecialSurface* newSurface(const SkImageInfo&) const; |
50 | 50 |
(...skipping 24 matching lines...) Expand all Loading... |
75 GrTexture* peekTexture() const; | 75 GrTexture* peekTexture() const; |
76 | 76 |
77 private: | 77 private: |
78 const SkIRect fSubset; | 78 const SkIRect fSubset; |
79 | 79 |
80 typedef SkRefCnt INHERITED; | 80 typedef SkRefCnt INHERITED; |
81 }; | 81 }; |
82 | 82 |
83 #endif | 83 #endif |
84 | 84 |
OLD | NEW |