OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
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 #include "SkSurface_Base.h" | 8 #include "SkSurface_Base.h" |
9 #include "SkImagePriv.h" | 9 #include "SkImagePriv.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 fCachedCanvas->setSurfaceBase(NULL); | 69 fCachedCanvas->setSurfaceBase(NULL); |
70 } | 70 } |
71 | 71 |
72 SkSafeUnref(fCachedImage); | 72 SkSafeUnref(fCachedImage); |
73 SkSafeUnref(fCachedCanvas); | 73 SkSafeUnref(fCachedCanvas); |
74 } | 74 } |
75 | 75 |
76 void SkSurface_Base::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPa
int* paint) { | 76 void SkSurface_Base::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPa
int* paint) { |
77 SkImage* image = this->newImageSnapshot(); | 77 SkImage* image = this->newImageSnapshot(); |
78 if (image) { | 78 if (image) { |
79 image->draw(canvas, x, y, paint); | 79 canvas->drawImage(image, x, y, paint); |
80 image->unref(); | 80 image->unref(); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 void SkSurface_Base::aboutToDraw(ContentChangeMode mode) { | 84 void SkSurface_Base::aboutToDraw(ContentChangeMode mode) { |
85 this->dirtyGenerationID(); | 85 this->dirtyGenerationID(); |
86 | 86 |
87 SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this); | 87 SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this); |
88 | 88 |
89 if (fCachedImage) { | 89 if (fCachedImage) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 SkSurface* SkSurface::NewRenderTarget(GrContext*, const SkImageInfo&, int, const
SkSurfaceProps*) { | 204 SkSurface* SkSurface::NewRenderTarget(GrContext*, const SkImageInfo&, int, const
SkSurfaceProps*) { |
205 return NULL; | 205 return NULL; |
206 } | 206 } |
207 | 207 |
208 SkSurface* SkSurface::NewScratchRenderTarget(GrContext*, const SkImageInfo&, int
sampleCount, | 208 SkSurface* SkSurface::NewScratchRenderTarget(GrContext*, const SkImageInfo&, int
sampleCount, |
209 const SkSurfaceProps*) { | 209 const SkSurfaceProps*) { |
210 return NULL; | 210 return NULL; |
211 } | 211 } |
212 | 212 |
213 #endif | 213 #endif |
OLD | NEW |