Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: include/core/SkShader.h

Issue 196473010: bitmapshader with A8 bitmap should be colorized by the paint's color (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkPaint.h ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « include/core/SkPaint.h ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698