OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
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 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 * New device that will create an offscreen renderTarget based on the | 49 * New device that will create an offscreen renderTarget based on the |
50 * ImageInfo and sampleCount. The device's storage will not | 50 * ImageInfo and sampleCount. The device's storage will not |
51 * count against the GrContext's texture cache budget. The device's pixels | 51 * count against the GrContext's texture cache budget. The device's pixels |
52 * will be uninitialized. On failure, returns NULL. | 52 * will be uninitialized. On failure, returns NULL. |
53 */ | 53 */ |
54 static SkGpuDevice* Create(GrContext*, const SkImageInfo&, const SkSurfacePr ops&, | 54 static SkGpuDevice* Create(GrContext*, const SkImageInfo&, const SkSurfacePr ops&, |
55 int sampleCount); | 55 int sampleCount); |
56 | 56 |
57 virtual ~SkGpuDevice(); | 57 virtual ~SkGpuDevice(); |
58 | 58 |
59 SkGpuDevice* cloneDevice() { | |
60 return static_cast<SkGpuDevice*>(this->onCreateDevice(this->imageInfo(), kGeneral_Usage)); | |
61 } | |
62 | |
59 GrContext* context() const { return fContext; } | 63 GrContext* context() const { return fContext; } |
60 | 64 |
61 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; | 65 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; |
62 | 66 |
63 virtual SkImageInfo imageInfo() const SK_OVERRIDE { | 67 virtual SkImageInfo imageInfo() const SK_OVERRIDE { |
64 return fRenderTarget ? fRenderTarget->surfacePriv().info() : SkImageInfo ::MakeUnknown(); | 68 return fRenderTarget ? fRenderTarget->surfacePriv().info() : SkImageInfo ::MakeUnknown(); |
65 } | 69 } |
66 | 70 |
67 virtual void clear(SkColor color) SK_OVERRIDE; | 71 virtual void clear(SkColor color) SK_OVERRIDE; |
68 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; | 72 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; |
(...skipping 26 matching lines...) Expand all Loading... | |
95 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, | 99 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, |
96 const SkPath& path, const SkMatrix* matrix, | 100 const SkPath& path, const SkMatrix* matrix, |
97 const SkPaint&) SK_OVERRIDE; | 101 const SkPaint&) SK_OVERRIDE; |
98 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou nt, | 102 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou nt, |
99 const SkPoint verts[], const SkPoint texs[], | 103 const SkPoint verts[], const SkPoint texs[], |
100 const SkColor colors[], SkXfermode* xmode, | 104 const SkColor colors[], SkXfermode* xmode, |
101 const uint16_t indices[], int indexCount, | 105 const uint16_t indices[], int indexCount, |
102 const SkPaint&) SK_OVERRIDE; | 106 const SkPaint&) SK_OVERRIDE; |
103 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 107 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
104 const SkPaint&) SK_OVERRIDE; | 108 const SkPaint&) SK_OVERRIDE; |
105 virtual bool filterTextFlags(const SkPaint&, TextFlags*) SK_OVERRIDE; | |
106 | 109 |
107 virtual void flush() SK_OVERRIDE; | 110 virtual void flush() SK_OVERRIDE; |
108 | 111 |
109 virtual void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; | 112 virtual void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; |
110 virtual void onDetachFromCanvas() SK_OVERRIDE; | 113 virtual void onDetachFromCanvas() SK_OVERRIDE; |
111 | 114 |
112 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; | 115 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; |
113 | 116 |
114 virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE; | 117 virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE; |
115 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, | 118 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, |
116 const SkImageFilter::Context&, | 119 const SkImageFilter::Context&, |
117 SkBitmap*, SkIPoint*) SK_OVERRIDE; | 120 SkBitmap*, SkIPoint*) SK_OVERRIDE; |
118 | 121 |
119 protected: | 122 protected: |
120 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) SK_OV ERRIDE; | 123 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) SK_OV ERRIDE; |
121 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int ) SK_OVERRIDE; | 124 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int ) SK_OVERRIDE; |
125 bool onDisableLCD(const SkPaint&) const SK_OVERRIDE; | |
f(malita)
2014/11/12 20:49:14
virtual
| |
122 | 126 |
123 /** PRIVATE / EXPERIMENTAL -- do not call */ | 127 /** PRIVATE / EXPERIMENTAL -- do not call */ |
124 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pic ture, | 128 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pic ture, |
125 const SkMatrix*, const SkPaint*) SK_OV ERRIDE; | 129 const SkMatrix*, const SkPaint*) SK_OV ERRIDE; |
126 | 130 |
127 private: | 131 private: |
128 GrContext* fContext; | 132 GrContext* fContext; |
129 | 133 |
130 GrSkDrawProcs* fDrawProcs; | 134 GrSkDrawProcs* fDrawProcs; |
131 | 135 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 bool bicubic); | 198 bool bicubic); |
195 | 199 |
196 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); | 200 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); |
197 | 201 |
198 static SkPicture::AccelData::Key ComputeAccelDataKey(); | 202 static SkPicture::AccelData::Key ComputeAccelDataKey(); |
199 | 203 |
200 typedef SkBaseDevice INHERITED; | 204 typedef SkBaseDevice INHERITED; |
201 }; | 205 }; |
202 | 206 |
203 #endif | 207 #endif |
OLD | NEW |