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

Side by Side Diff: tests/PictureTest.cpp

Issue 789033002: Remove SkCanvas::drawBitmapMatrix() (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: non-const canvas ptr 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 | « src/utils/debugger/SkDrawCommand.cpp ('k') | tests/SurfaceTest.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 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 } 1772 }
1773 1773
1774 static void draw_bitmaps(const SkBitmap bitmap, SkCanvas* canvas) { 1774 static void draw_bitmaps(const SkBitmap bitmap, SkCanvas* canvas) {
1775 const SkPaint paint; 1775 const SkPaint paint;
1776 const SkRect rect = { 5.0f, 5.0f, 8.0f, 8.0f }; 1776 const SkRect rect = { 5.0f, 5.0f, 8.0f, 8.0f };
1777 const SkIRect irect = { 2, 2, 3, 3 }; 1777 const SkIRect irect = { 2, 2, 3, 3 };
1778 1778
1779 // Don't care what these record, as long as they're legal. 1779 // Don't care what these record, as long as they're legal.
1780 canvas->drawBitmap(bitmap, 0.0f, 0.0f, &paint); 1780 canvas->drawBitmap(bitmap, 0.0f, 0.0f, &paint);
1781 canvas->drawBitmapRectToRect(bitmap, &rect, rect, &paint, SkCanvas::kNone_Dr awBitmapRectFlag); 1781 canvas->drawBitmapRectToRect(bitmap, &rect, rect, &paint, SkCanvas::kNone_Dr awBitmapRectFlag);
1782 canvas->drawBitmapMatrix(bitmap, SkMatrix::I(), &paint);
1783 canvas->drawBitmapNine(bitmap, irect, rect, &paint); 1782 canvas->drawBitmapNine(bitmap, irect, rect, &paint);
1784 canvas->drawSprite(bitmap, 1, 1); 1783 canvas->drawSprite(bitmap, 1, 1);
1785 } 1784 }
1786 1785
1787 static void test_draw_bitmaps(SkCanvas* canvas) { 1786 static void test_draw_bitmaps(SkCanvas* canvas) {
1788 SkBitmap empty; 1787 SkBitmap empty;
1789 draw_bitmaps(empty, canvas); 1788 draw_bitmaps(empty, canvas);
1790 empty.setInfo(SkImageInfo::MakeN32Premul(10, 10)); 1789 empty.setInfo(SkImageInfo::MakeN32Premul(10, 10));
1791 draw_bitmaps(empty, canvas); 1790 draw_bitmaps(empty, canvas);
1792 } 1791 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 1918
1920 // The picture shares the immutable pixels but copies the mutable ones. 1919 // The picture shares the immutable pixels but copies the mutable ones.
1921 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1920 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1922 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); 1921 REPORTER_ASSERT(r, !immut.pixelRef()->unique());
1923 1922
1924 // When the picture goes away, it's just our bitmaps holding the refs. 1923 // When the picture goes away, it's just our bitmaps holding the refs.
1925 pic.reset(NULL); 1924 pic.reset(NULL);
1926 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1925 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1927 REPORTER_ASSERT(r, immut.pixelRef()->unique()); 1926 REPORTER_ASSERT(r, immut.pixelRef()->unique());
1928 } 1927 }
OLDNEW
« no previous file with comments | « src/utils/debugger/SkDrawCommand.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698