| 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(const SkSurfaceProps& props) { |
| 60 SkBaseDevice* dev = this->onCreateCompatibleDevice(CreateInfo(this->imag
eInfo(), |
| 61 kGeneral_U
sage, |
| 62 props.pixe
lGeometry())); |
| 63 return static_cast<SkGpuDevice*>(dev); |
| 64 } |
| 65 |
| 59 GrContext* context() const { return fContext; } | 66 GrContext* context() const { return fContext; } |
| 60 | 67 |
| 61 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; | 68 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; |
| 62 | 69 |
| 63 virtual SkImageInfo imageInfo() const SK_OVERRIDE { | 70 virtual SkImageInfo imageInfo() const SK_OVERRIDE { |
| 64 return fRenderTarget ? fRenderTarget->surfacePriv().info() : SkImageInfo
::MakeUnknown(); | 71 return fRenderTarget ? fRenderTarget->surfacePriv().info() : SkImageInfo
::MakeUnknown(); |
| 65 } | 72 } |
| 66 | 73 |
| 67 virtual void clear(SkColor color) SK_OVERRIDE; | 74 virtual void clear(SkColor color) SK_OVERRIDE; |
| 68 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; | 75 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, | 102 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, |
| 96 const SkPath& path, const SkMatrix* matrix, | 103 const SkPath& path, const SkMatrix* matrix, |
| 97 const SkPaint&) SK_OVERRIDE; | 104 const SkPaint&) SK_OVERRIDE; |
| 98 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, | 105 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, |
| 99 const SkPoint verts[], const SkPoint texs[], | 106 const SkPoint verts[], const SkPoint texs[], |
| 100 const SkColor colors[], SkXfermode* xmode, | 107 const SkColor colors[], SkXfermode* xmode, |
| 101 const uint16_t indices[], int indexCount, | 108 const uint16_t indices[], int indexCount, |
| 102 const SkPaint&) SK_OVERRIDE; | 109 const SkPaint&) SK_OVERRIDE; |
| 103 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 110 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
| 104 const SkPaint&) SK_OVERRIDE; | 111 const SkPaint&) SK_OVERRIDE; |
| 105 virtual bool filterTextFlags(const SkPaint&, TextFlags*) SK_OVERRIDE; | |
| 106 | 112 |
| 107 virtual void flush() SK_OVERRIDE; | 113 virtual void flush() SK_OVERRIDE; |
| 108 | 114 |
| 109 virtual void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; | 115 virtual void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; |
| 110 virtual void onDetachFromCanvas() SK_OVERRIDE; | 116 virtual void onDetachFromCanvas() SK_OVERRIDE; |
| 111 | 117 |
| 112 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; | 118 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; |
| 113 | 119 |
| 114 virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE; | 120 virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE; |
| 115 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, | 121 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, |
| 116 const SkImageFilter::Context&, | 122 const SkImageFilter::Context&, |
| 117 SkBitmap*, SkIPoint*) SK_OVERRIDE; | 123 SkBitmap*, SkIPoint*) SK_OVERRIDE; |
| 118 | 124 |
| 119 protected: | 125 protected: |
| 120 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) SK_OV
ERRIDE; | 126 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; | 127 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int
) SK_OVERRIDE; |
| 128 bool onShouldDisableLCD(const SkPaint&) const SK_OVERRIDE; |
| 122 | 129 |
| 123 /** PRIVATE / EXPERIMENTAL -- do not call */ | 130 /** PRIVATE / EXPERIMENTAL -- do not call */ |
| 124 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pic
ture, | 131 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pic
ture, |
| 125 const SkMatrix*, const SkPaint*) SK_OV
ERRIDE; | 132 const SkMatrix*, const SkPaint*) SK_OV
ERRIDE; |
| 126 | 133 |
| 127 private: | 134 private: |
| 128 GrContext* fContext; | 135 GrContext* fContext; |
| 129 | 136 |
| 130 GrSkDrawProcs* fDrawProcs; | 137 GrSkDrawProcs* fDrawProcs; |
| 131 | 138 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 bool bicubic); | 201 bool bicubic); |
| 195 | 202 |
| 196 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); | 203 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); |
| 197 | 204 |
| 198 static SkPicture::AccelData::Key ComputeAccelDataKey(); | 205 static SkPicture::AccelData::Key ComputeAccelDataKey(); |
| 199 | 206 |
| 200 typedef SkBaseDevice INHERITED; | 207 typedef SkBaseDevice INHERITED; |
| 201 }; | 208 }; |
| 202 | 209 |
| 203 #endif | 210 #endif |
| OLD | NEW |