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 #ifndef SkImage_DEFINED | 8 #ifndef SkImage_DEFINED |
9 #define SkImage_DEFINED | 9 #define SkImage_DEFINED |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 const SkISize yuvSizes[3], | 143 const SkISize yuvSizes[3], |
144 GrSurfaceOrigin); | 144 GrSurfaceOrigin); |
145 | 145 |
146 static SkImage* NewFromPicture(const SkPicture*, const SkISize& dimensions, | 146 static SkImage* NewFromPicture(const SkPicture*, const SkISize& dimensions, |
147 const SkMatrix*, const SkPaint*); | 147 const SkMatrix*, const SkPaint*); |
148 | 148 |
149 ////////////////////////////////////////////////////////////////////////////
/////////////////// | 149 ////////////////////////////////////////////////////////////////////////////
/////////////////// |
150 | 150 |
151 int width() const { return fWidth; } | 151 int width() const { return fWidth; } |
152 int height() const { return fHeight; } | 152 int height() const { return fHeight; } |
| 153 SkISize dimensions() const { return SkISize::Make(fWidth, fHeight); } |
| 154 SkIRect bounds() const { return SkIRect::MakeWH(fWidth, fHeight); } |
153 uint32_t uniqueID() const { return fUniqueID; } | 155 uint32_t uniqueID() const { return fUniqueID; } |
154 virtual bool isOpaque() const { return false; } | 156 virtual bool isOpaque() const { return false; } |
155 | 157 |
156 virtual SkShader* newShader(SkShader::TileMode, | 158 virtual SkShader* newShader(SkShader::TileMode, |
157 SkShader::TileMode, | 159 SkShader::TileMode, |
158 const SkMatrix* localMatrix = NULL) const; | 160 const SkMatrix* localMatrix = NULL) const; |
159 | 161 |
160 /** | 162 /** |
161 * If the image has direct access to its pixels (i.e. they are in local | 163 * If the image has direct access to its pixels (i.e. they are in local |
162 * RAM) return the (const) address of those pixels, and if not null, return | 164 * RAM) return the (const) address of those pixels, and if not null, return |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 331 |
330 private: | 332 private: |
331 const int fWidth; | 333 const int fWidth; |
332 const int fHeight; | 334 const int fHeight; |
333 const uint32_t fUniqueID; | 335 const uint32_t fUniqueID; |
334 | 336 |
335 typedef SkRefCnt INHERITED; | 337 typedef SkRefCnt INHERITED; |
336 }; | 338 }; |
337 | 339 |
338 #endif | 340 #endif |
OLD | NEW |