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

Side by Side Diff: tests/DeferredCanvasTest.cpp

Issue 741763002: add SkImage::newSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: another warning fix Created 6 years, 1 month 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/SkSurface_Raster.cpp ('k') | no next file » | 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 "../src/image/SkImagePriv.h" 8 #include "../src/image/SkImagePriv.h"
9 #include "../src/image/SkSurface_Base.h" 9 #include "../src/image/SkSurface_Base.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 virtual SkCanvas* onNewCanvas() SK_OVERRIDE { 59 virtual SkCanvas* onNewCanvas() SK_OVERRIDE {
60 return SkNEW_ARGS(SkCanvas, (fBitmap)); 60 return SkNEW_ARGS(SkCanvas, (fBitmap));
61 } 61 }
62 62
63 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE { 63 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE {
64 return NULL; 64 return NULL;
65 } 65 }
66 66
67 virtual SkImage* onNewImageSnapshot() SK_OVERRIDE { 67 virtual SkImage* onNewImageSnapshot() SK_OVERRIDE {
68 return SkNewImageFromBitmap(fBitmap, true); 68 return SkNewImageFromBitmap(fBitmap, true, &this->props());
69 } 69 }
70 70
71 virtual void onCopyOnWrite(ContentChangeMode mode) SK_OVERRIDE { 71 virtual void onCopyOnWrite(ContentChangeMode mode) SK_OVERRIDE {
72 if (mode == SkSurface::kDiscard_ContentChangeMode) { 72 if (mode == SkSurface::kDiscard_ContentChangeMode) {
73 fDiscardCount++; 73 fDiscardCount++;
74 } else { 74 } else {
75 fRetainCount++; 75 fRetainCount++;
76 } 76 }
77 } 77 }
78 78
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 TestDeferredCanvasSurface(reporter, NULL); 907 TestDeferredCanvasSurface(reporter, NULL);
908 TestDeferredCanvasSetSurface(reporter, NULL); 908 TestDeferredCanvasSetSurface(reporter, NULL);
909 } 909 }
910 910
911 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) { 911 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) {
912 if (factory != NULL) { 912 if (factory != NULL) {
913 TestDeferredCanvasSurface(reporter, factory); 913 TestDeferredCanvasSurface(reporter, factory);
914 TestDeferredCanvasSetSurface(reporter, factory); 914 TestDeferredCanvasSetSurface(reporter, factory);
915 } 915 }
916 } 916 }
OLDNEW
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698