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

Side by Side Diff: tests/PDFInvalidBitmapTest.cpp

Issue 1279123007: SkPDF: allow PDF module to be disabled in DM and SampleApp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-11 (Tuesday) 10:04:57 EDT : #if SK_SUPPORT_PDF 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDocument.h" 10 #include "SkDocument.h"
11 #include "SkImageInfo.h" 11 #include "SkImageInfo.h"
12 #include "SkPixelRef.h" 12 #include "SkPixelRef.h"
13 #include "SkRefCnt.h" 13 #include "SkRefCnt.h"
14 #include "SkStream.h" 14 #include "SkStream.h"
15 15
16 #include "Test.h" 16 #include "Test.h"
17 17
18 #if SK_SUPPORT_PDF
19
18 namespace { 20 namespace {
19 21
20 // SkPixelRef which fails to lock, as a lazy pixel ref might if its pixels 22 // SkPixelRef which fails to lock, as a lazy pixel ref might if its pixels
21 // cannot be generated. 23 // cannot be generated.
22 class InvalidPixelRef : public SkPixelRef { 24 class InvalidPixelRef : public SkPixelRef {
23 public: 25 public:
24 InvalidPixelRef(const SkImageInfo& info) : SkPixelRef(info) {} 26 InvalidPixelRef(const SkImageInfo& info) : SkPixelRef(info) {}
25 private: 27 private:
26 bool onNewLockPixels(LockRec*) override { return false; } 28 bool onNewLockPixels(LockRec*) override { return false; }
27 void onUnlockPixels() override { 29 void onUnlockPixels() override {
(...skipping 23 matching lines...) Expand all
51 canvas->drawBitmap(SkBitmap(), 0, 0); 53 canvas->drawBitmap(SkBitmap(), 0, 0);
52 canvas->drawBitmap(make_invalid_bitmap(SkImageInfo()), 0, 0); 54 canvas->drawBitmap(make_invalid_bitmap(SkImageInfo()), 0, 0);
53 canvas->drawBitmap(make_invalid_bitmap(kN32_SkColorType), 0, 0); 55 canvas->drawBitmap(make_invalid_bitmap(kN32_SkColorType), 0, 0);
54 canvas->drawBitmap(make_invalid_bitmap(kIndex_8_SkColorType), 0, 0); 56 canvas->drawBitmap(make_invalid_bitmap(kIndex_8_SkColorType), 0, 0);
55 canvas->drawBitmap(make_invalid_bitmap(kARGB_4444_SkColorType), 0, 0); 57 canvas->drawBitmap(make_invalid_bitmap(kARGB_4444_SkColorType), 0, 0);
56 canvas->drawBitmap(make_invalid_bitmap(kRGB_565_SkColorType), 0, 0); 58 canvas->drawBitmap(make_invalid_bitmap(kRGB_565_SkColorType), 0, 0);
57 canvas->drawBitmap(make_invalid_bitmap(kAlpha_8_SkColorType), 0, 0); 59 canvas->drawBitmap(make_invalid_bitmap(kAlpha_8_SkColorType), 0, 0);
58 60
59 // This test passes if it does not crash. 61 // This test passes if it does not crash.
60 } 62 }
63 #endif // SK_SUPPORT_PDF
OLDNEW
« samplecode/SampleApp.cpp ('K') | « tests/FlateTest.cpp ('k') | tests/PDFJpegEmbedTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698