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

Side by Side Diff: src/image/SkSurface.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | src/image/SkSurface_Base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 27 matching lines...) Expand all
38 image->draw(canvas, x, y, paint); 38 image->draw(canvas, x, y, paint);
39 image->unref(); 39 image->unref();
40 } 40 }
41 } 41 }
42 42
43 void SkSurface_Base::aboutToDraw(ContentChangeMode mode) { 43 void SkSurface_Base::aboutToDraw(ContentChangeMode mode) {
44 this->dirtyGenerationID(); 44 this->dirtyGenerationID();
45 45
46 SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this); 46 SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this);
47 47
48 if (NULL != fCachedImage) { 48 if (fCachedImage) {
49 // the surface may need to fork its backend, if its sharing it with 49 // the surface may need to fork its backend, if its sharing it with
50 // the cached image. Note: we only call if there is an outstanding owner 50 // the cached image. Note: we only call if there is an outstanding owner
51 // on the image (besides us). 51 // on the image (besides us).
52 if (!fCachedImage->unique()) { 52 if (!fCachedImage->unique()) {
53 this->onCopyOnWrite(mode); 53 this->onCopyOnWrite(mode);
54 } 54 }
55 55
56 // regardless of copy-on-write, we must drop our cached image now, so 56 // regardless of copy-on-write, we must drop our cached image now, so
57 // that the next request will get our new contents. 57 // that the next request will get our new contents.
58 fCachedImage->unref(); 58 fCachedImage->unref();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y, 114 void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y,
115 const SkPaint* paint) { 115 const SkPaint* paint) {
116 return asSB(this)->onDraw(canvas, x, y, paint); 116 return asSB(this)->onDraw(canvas, x, y, paint);
117 } 117 }
118 118
119 const void* SkSurface::peekPixels(SkImageInfo* info, size_t* rowBytes) { 119 const void* SkSurface::peekPixels(SkImageInfo* info, size_t* rowBytes) {
120 return this->getCanvas()->peekPixels(info, rowBytes); 120 return this->getCanvas()->peekPixels(info, rowBytes);
121 } 121 }
OLDNEW
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | src/image/SkSurface_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698