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

Side by Side Diff: tests/DeferredCanvasTest.cpp

Issue 1266143003: lock pixels in image when bitmap is immutable and not-lazy (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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/SkSurface_Raster.cpp ('k') | tests/ImageTest.cpp » ('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 "../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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 SkCanvas* onNewCanvas() override { 58 SkCanvas* onNewCanvas() override {
59 return SkNEW_ARGS(SkCanvas, (fBitmap)); 59 return SkNEW_ARGS(SkCanvas, (fBitmap));
60 } 60 }
61 61
62 SkSurface* onNewSurface(const SkImageInfo&) override { 62 SkSurface* onNewSurface(const SkImageInfo&) override {
63 return NULL; 63 return NULL;
64 } 64 }
65 65
66 SkImage* onNewImageSnapshot(Budgeted) override { 66 SkImage* onNewImageSnapshot(Budgeted) override {
67 return SkNewImageFromRasterBitmap(fBitmap, &this->props(), kUnlocked_Sha redPixelRefMode); 67 return SkNewImageFromRasterBitmap(fBitmap, &this->props());
f(malita) 2015/07/31 03:12:24 Just making sure: this is no longer necessary beca
68 } 68 }
69 69
70 void onCopyOnWrite(ContentChangeMode mode) override { 70 void onCopyOnWrite(ContentChangeMode mode) override {
71 if (mode == SkSurface::kDiscard_ContentChangeMode) { 71 if (mode == SkSurface::kDiscard_ContentChangeMode) {
72 fCOWDiscardCount++; 72 fCOWDiscardCount++;
73 } else { 73 } else {
74 fCOWRetainCount++; 74 fCOWRetainCount++;
75 } 75 }
76 } 76 }
77 77
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 TestDeferredCanvasSurface(reporter, NULL); 939 TestDeferredCanvasSurface(reporter, NULL);
940 TestDeferredCanvasSetSurface(reporter, NULL); 940 TestDeferredCanvasSetSurface(reporter, NULL);
941 } 941 }
942 942
943 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) { 943 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) {
944 if (factory != NULL) { 944 if (factory != NULL) {
945 TestDeferredCanvasSurface(reporter, factory); 945 TestDeferredCanvasSurface(reporter, factory);
946 TestDeferredCanvasSetSurface(reporter, factory); 946 TestDeferredCanvasSetSurface(reporter, factory);
947 } 947 }
948 } 948 }
OLDNEW
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698