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

Side by Side Diff: tests/PictureTest.cpp

Issue 745383003: add some debugging to SkNVRefCnt (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix bench Created 6 years 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 | « tests/PictureBBHTest.cpp ('k') | tests/RecordingXfermodeTest.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 "SkBBoxHierarchy.h" 8 #include "SkBBoxHierarchy.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 SkASSERT(immut.isImmutable()); 1902 SkASSERT(immut.isImmutable());
1903 1903
1904 // No one can hold a ref on our pixels yet. 1904 // No one can hold a ref on our pixels yet.
1905 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1905 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1906 REPORTER_ASSERT(r, immut.pixelRef()->unique()); 1906 REPORTER_ASSERT(r, immut.pixelRef()->unique());
1907 1907
1908 SkPictureRecorder rec; 1908 SkPictureRecorder rec;
1909 SkCanvas* canvas = rec.beginRecording(1920, 1200); 1909 SkCanvas* canvas = rec.beginRecording(1920, 1200);
1910 canvas->drawBitmap(mut, 0, 0); 1910 canvas->drawBitmap(mut, 0, 0);
1911 canvas->drawBitmap(immut, 800, 600); 1911 canvas->drawBitmap(immut, 800, 600);
1912 SkAutoTDelete<const SkPicture> pic(rec.endRecording()); 1912 SkAutoTUnref<const SkPicture> pic(rec.endRecording());
1913 1913
1914 // The picture shares the immutable pixels but copies the mutable ones. 1914 // The picture shares the immutable pixels but copies the mutable ones.
1915 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1915 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1916 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); 1916 REPORTER_ASSERT(r, !immut.pixelRef()->unique());
1917 1917
1918 // When the picture goes away, it's just our bitmaps holding the refs. 1918 // When the picture goes away, it's just our bitmaps holding the refs.
1919 pic.reset(NULL); 1919 pic.reset(NULL);
1920 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1920 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1921 REPORTER_ASSERT(r, immut.pixelRef()->unique()); 1921 REPORTER_ASSERT(r, immut.pixelRef()->unique());
1922 } 1922 }
OLDNEW
« no previous file with comments | « tests/PictureBBHTest.cpp ('k') | tests/RecordingXfermodeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698