| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 return image.release(); | 264 return image.release(); |
| 265 } | 265 } |
| 266 | 266 |
| 267 bool Image::isTextureBacked() | 267 bool Image::isTextureBacked() |
| 268 { | 268 { |
| 269 RefPtr<SkImage> image = imageForCurrentFrame(); | 269 RefPtr<SkImage> image = imageForCurrentFrame(); |
| 270 return image ? image->isTextureBacked() : false; | 270 return image ? image->isTextureBacked() : false; |
| 271 } | 271 } |
| 272 | 272 |
| 273 bool Image::applyShader(SkPaint& paint, const SkMatrix* localMatrix) |
| 274 { |
| 275 // Default shader impl: attempt to build a shader based on the current frame
SkImage. |
| 276 RefPtr<SkImage> image = imageForCurrentFrame(); |
| 277 if (!image) |
| 278 return false; |
| 279 |
| 280 paint.setShader( |
| 281 image->makeShader(SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode
, localMatrix)); |
| 282 |
| 283 return true; |
| 284 } |
| 285 |
| 273 } // namespace blink | 286 } // namespace blink |
| OLD | NEW |