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

Side by Side Diff: src/core/SkBitmapProcShader.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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkBitmapProcShader_DEFINED 10 #ifndef SkBitmapProcShader_DEFINED
(...skipping 12 matching lines...) Expand all
23 virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK _OVERRIDE; 23 virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK _OVERRIDE;
24 virtual void endContext() SK_OVERRIDE; 24 virtual void endContext() SK_OVERRIDE;
25 virtual uint32_t getFlags() SK_OVERRIDE { return fFlags; } 25 virtual uint32_t getFlags() SK_OVERRIDE { return fFlags; }
26 virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRID E; 26 virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRID E;
27 virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE; 27 virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE;
28 virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRI DE; 28 virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRI DE;
29 virtual BitmapType asABitmap(SkBitmap*, SkMatrix*, TileMode*) const SK_OVERR IDE; 29 virtual BitmapType asABitmap(SkBitmap*, SkMatrix*, TileMode*) const SK_OVERR IDE;
30 30
31 static bool CanDo(const SkBitmap&, TileMode tx, TileMode ty); 31 static bool CanDo(const SkBitmap&, TileMode tx, TileMode ty);
32 32
33 virtual SkBitmap* getBitmap() { return &fRawBitmap;}
34
33 SK_DEVELOPER_TO_STRING() 35 SK_DEVELOPER_TO_STRING()
34 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapProcShader) 36 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapProcShader)
35 37
36 #if SK_SUPPORT_GPU 38 #if SK_SUPPORT_GPU
37 GrEffectRef* asNewEffect(GrContext*, const SkPaint&) const SK_OVERRIDE; 39 GrEffectRef* asNewEffect(GrContext*, const SkPaint&) const SK_OVERRIDE;
38 #endif 40 #endif
39 41
40 protected: 42 protected:
41 SkBitmapProcShader(SkReadBuffer& ); 43 SkBitmapProcShader(SkReadBuffer& );
42 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 44 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
(...skipping 10 matching lines...) Expand all
53 // bytes requested is calculated using one of our large shaders plus the size of an Sk3DBlitter 55 // bytes requested is calculated using one of our large shaders plus the size of an Sk3DBlitter
54 // in SkDraw.cpp 56 // in SkDraw.cpp
55 typedef SkSmallAllocator<2, sizeof(SkBitmapProcShader) + sizeof(void*) * 2> SkTB litterAllocator; 57 typedef SkSmallAllocator<2, sizeof(SkBitmapProcShader) + sizeof(void*) * 2> SkTB litterAllocator;
56 58
57 // If alloc is non-NULL, it will be used to allocate the returned SkShader, and MUST outlive 59 // If alloc is non-NULL, it will be used to allocate the returned SkShader, and MUST outlive
58 // the SkShader. 60 // the SkShader.
59 SkShader* CreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader:: TileMode, 61 SkShader* CreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader:: TileMode,
60 SkTBlitterAllocator* alloc); 62 SkTBlitterAllocator* alloc);
61 63
62 #endif 64 #endif
OLDNEW
« include/core/SkShader.h ('K') | « include/core/SkShader.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698