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

Side by Side Diff: src/core/SkPictureShader.h

Issue 221923007: Initial picture shader implementation (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Win build fix + SkShader factory. Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkPictureShader_DEFINED
9 #define SkPictureShader_DEFINED
10
11 #include "SkShader.h"
12
13 class SkBitmap;
14 class SkPicture;
15
robertphillips 2014/04/02 18:15:35 // The SkPictureShader ...
f(malita) 2014/04/07 15:06:24 Done.
16 class SkPictureShader : public SkShader {
reed1 2014/04/07 14:03:15 Defensively, lets keep this private, and just expo
f(malita) 2014/04/07 15:06:24 Done.
17 public:
18 SkPictureShader(SkPicture*, TileMode, TileMode);
19 virtual ~SkPictureShader();
20
21 virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK _OVERRIDE;
22 virtual void endContext() SK_OVERRIDE;
23 virtual uint32_t getFlags() SK_OVERRIDE;
24
25 virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE;
26 virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRID E;
27 virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRI DE;
28
29 SK_TO_STRING_OVERRIDE()
30 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureShader)
31
32 #if SK_SUPPORT_GPU
33 GrEffectRef* asNewEffect(GrContext*, const SkPaint&) const SK_OVERRIDE;
34 #endif
35
36 protected:
37 SkPictureShader(SkReadBuffer&);
38 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
39
40 private:
41 bool buildBitmapShader(const SkMatrix&) const;
42
robertphillips 2014/04/02 18:15:35 this should go last.
f(malita) 2014/04/07 15:06:24 Done.
43 typedef SkShader INHERITED;
44
45 SkPicture* fPicture;
46 TileMode fTmx, fTmy;
47
48 mutable SkAutoTUnref<SkShader> fCachedShader;
49 mutable SkSize fCachedTileScale;
50 };
51
52 #endif // SkPictureShader_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698