Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 | 8 |
| 9 #ifndef SkShader_DEFINED | 9 #ifndef SkShader_DEFINED |
| 10 #define SkShader_DEFINED | 10 #define SkShader_DEFINED |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 * the paint. | 338 * the paint. |
| 339 * | 339 * |
| 340 * @param src The bitmap to use inside the shader | 340 * @param src The bitmap to use inside the shader |
| 341 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir ection. | 341 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir ection. |
| 342 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir ection. | 342 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir ection. |
| 343 * @return Returns a new shader object. Note: this function never retur ns null. | 343 * @return Returns a new shader object. Note: this function never retur ns null. |
| 344 */ | 344 */ |
| 345 static SkShader* CreateBitmapShader(const SkBitmap& src, | 345 static SkShader* CreateBitmapShader(const SkBitmap& src, |
| 346 TileMode tmx, TileMode tmy); | 346 TileMode tmx, TileMode tmy); |
| 347 | 347 |
| 348 virtual SkBitmap* getBitmap() { return NULL;} | |
|
bsalomon
2014/03/13 14:59:04
I don't think the Shader should expose a bitmap. I
yunchao
2014/03/13 15:05:12
What about expose an interface like this: bool isA
yunchao
2014/03/13 15:32:28
Do you think it is unsafe if the shader expose a b
| |
| 349 | |
| 348 SkDEVCODE(virtual void toString(SkString* str) const;) | 350 SkDEVCODE(virtual void toString(SkString* str) const;) |
| 349 | 351 |
| 350 SK_DEFINE_FLATTENABLE_TYPE(SkShader) | 352 SK_DEFINE_FLATTENABLE_TYPE(SkShader) |
| 351 | 353 |
| 352 protected: | 354 protected: |
| 353 enum MatrixClass { | 355 enum MatrixClass { |
| 354 kLinear_MatrixClass, // no perspective | 356 kLinear_MatrixClass, // no perspective |
| 355 kFixedStepInX_MatrixClass, // fast perspective, need to call fixedS tepInX() each scanline | 357 kFixedStepInX_MatrixClass, // fast perspective, need to call fixedS tepInX() each scanline |
| 356 kPerspective_MatrixClass // slow perspective, need to mappoints e ach pixel | 358 kPerspective_MatrixClass // slow perspective, need to mappoints e ach pixel |
| 357 }; | 359 }; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 368 SkMatrix fLocalMatrix; | 370 SkMatrix fLocalMatrix; |
| 369 SkMatrix fTotalInverse; | 371 SkMatrix fTotalInverse; |
| 370 uint8_t fPaintAlpha; | 372 uint8_t fPaintAlpha; |
| 371 uint8_t fTotalInverseClass; | 373 uint8_t fTotalInverseClass; |
| 372 SkDEBUGCODE(SkBool8 fInSetContext;) | 374 SkDEBUGCODE(SkBool8 fInSetContext;) |
| 373 | 375 |
| 374 typedef SkFlattenable INHERITED; | 376 typedef SkFlattenable INHERITED; |
| 375 }; | 377 }; |
| 376 | 378 |
| 377 #endif | 379 #endif |
| OLD | NEW |