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

Side by Side Diff: skia/ext/platform_device.cc

Issue 1457033002: Get rid of unused skia::IsDraftMode() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig review Created 5 years, 1 month 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 | « skia/ext/platform_device.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "skia/ext/platform_device.h" 6 #include "skia/ext/platform_device.h"
7 7
8 #include "third_party/skia/include/core/SkMetaData.h" 8 #include "third_party/skia/include/core/SkMetaData.h"
9 9
10 namespace skia { 10 namespace skia {
11 11
12 namespace { 12 namespace {
13 13
14 const char* kDevicePlatformBehaviour = "CrDevicePlatformBehaviour"; 14 const char kDevicePlatformBehaviour[] = "CrDevicePlatformBehaviour";
15 const char* kDraftModeKey = "CrDraftMode";
16 15
17 #if defined(OS_MACOSX) || defined(OS_WIN) 16 #if defined(OS_MACOSX)
18 const char* kIsPreviewMetafileKey = "CrIsPreviewMetafile"; 17 const char kIsPreviewMetafileKey[] = "CrIsPreviewMetafile";
19 #endif 18 #endif
20 19
21 void SetBoolMetaData(const SkCanvas& canvas, const char* key, bool value) { 20 void SetBoolMetaData(const SkCanvas& canvas, const char* key, bool value) {
22 SkMetaData& meta = skia::getMetaData(canvas); 21 SkMetaData& meta = skia::getMetaData(canvas);
23 meta.setBool(key, value); 22 meta.setBool(key, value);
24 } 23 }
25 24
26 bool GetBoolMetaData(const SkCanvas& canvas, const char* key) { 25 bool GetBoolMetaData(const SkCanvas& canvas, const char* key) {
27 bool value; 26 bool value;
28 SkMetaData& meta = skia::getMetaData(canvas); 27 SkMetaData& meta = skia::getMetaData(canvas);
(...skipping 19 matching lines...) Expand all
48 } 47 }
49 return NULL; 48 return NULL;
50 } 49 }
51 50
52 SkMetaData& getMetaData(const SkCanvas& canvas) { 51 SkMetaData& getMetaData(const SkCanvas& canvas) {
53 SkBaseDevice* device = canvas.getDevice(); 52 SkBaseDevice* device = canvas.getDevice();
54 DCHECK(device != NULL); 53 DCHECK(device != NULL);
55 return device->getMetaData(); 54 return device->getMetaData();
56 } 55 }
57 56
58 void SetIsDraftMode(const SkCanvas& canvas, bool draft_mode) { 57 #if defined(OS_MACOSX)
59 SetBoolMetaData(canvas, kDraftModeKey, draft_mode);
60 }
61
62 bool IsDraftMode(const SkCanvas& canvas) {
63 return GetBoolMetaData(canvas, kDraftModeKey);
64 }
65
66 #if defined(OS_MACOSX) || defined(OS_WIN)
67 void SetIsPreviewMetafile(const SkCanvas& canvas, bool is_preview) { 58 void SetIsPreviewMetafile(const SkCanvas& canvas, bool is_preview) {
68 SetBoolMetaData(canvas, kIsPreviewMetafileKey, is_preview); 59 SetBoolMetaData(canvas, kIsPreviewMetafileKey, is_preview);
69 } 60 }
70 61
71 bool IsPreviewMetafile(const SkCanvas& canvas) { 62 bool IsPreviewMetafile(const SkCanvas& canvas) {
72 return GetBoolMetaData(canvas, kIsPreviewMetafileKey); 63 return GetBoolMetaData(canvas, kIsPreviewMetafileKey);
73 } 64 }
74 #endif 65 #endif
75 66
76 bool PlatformDevice::SupportsPlatformPaint() { 67 bool PlatformDevice::SupportsPlatformPaint() {
77 return true; 68 return true;
78 } 69 }
79 70
80 } // namespace skia 71 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/platform_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698