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

Side by Side Diff: tests/PDFJpegEmbedTest.cpp

Issue 1514503004: SkBitmap move (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-12-10 (Thursday) 17:55:13 EST Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "SkDocument.h" 8 #include "SkDocument.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImageGenerator.h" 10 #include "SkImageGenerator.h"
11 #include "SkData.h" 11 #include "SkData.h"
12 #include "SkStream.h" 12 #include "SkStream.h"
13 13
14 #include "Resources.h" 14 #include "Resources.h"
15 #include "Test.h" 15 #include "Test.h"
16 16
17 // Returned bitmap is lazy. Only lazy bitmaps hold onto the original data. 17 // Returned bitmap is lazy. Only lazy bitmaps hold onto the original data.
18 static SkBitmap bitmap_from_data(SkData* data) { 18 static SkBitmap bitmap_from_data(SkData* data) {
19 SkASSERT(data); 19 SkASSERT(data);
20 SkBitmap bm; 20 SkBitmap bm;
21 SkDEPRECATED_InstallDiscardablePixelRef(data, &bm); 21 SkDEPRECATED_InstallDiscardablePixelRef(data, &bm);
22 return bm; 22 return skstd::move(bm);
23 } 23 }
24 24
25 static bool is_subset_of(SkData* smaller, SkData* larger) { 25 static bool is_subset_of(SkData* smaller, SkData* larger) {
26 SkASSERT(smaller && larger); 26 SkASSERT(smaller && larger);
27 if (smaller->size() > larger->size()) { 27 if (smaller->size() > larger->size()) {
28 return false; 28 return false;
29 } 29 }
30 size_t size = smaller->size(); 30 size_t size = smaller->size();
31 size_t size_diff = larger->size() - size; 31 size_t size_diff = larger->size() - size;
32 for (size_t i = 0; i <= size_diff; ++i) { 32 for (size_t i = 0; i <= size_diff; ++i) {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 if (kTests[i].type != info.fType) { 142 if (kTests[i].type != info.fType) {
143 ERRORF(r, "%s failed jfif type test", kTests[i].path); 143 ERRORF(r, "%s failed jfif type test", kTests[i].path);
144 continue; 144 continue;
145 } 145 }
146 if (r->verbose()) { 146 if (r->verbose()) {
147 SkDebugf("\nJpegIdentification: %s [%d x %d]\n", kTests[i].path, 147 SkDebugf("\nJpegIdentification: %s [%d x %d]\n", kTests[i].path,
148 info.fSize.width(), info.fSize.height()); 148 info.fSize.width(), info.fSize.height());
149 } 149 }
150 } 150 }
151 } 151 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698