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

Unified Diff: skia/ext/platform_device.cc

Issue 2011713003: Roll skia to 8cc209111876b7c78b5ec577c9221d8ed5e21024 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/platform_device.h ('k') | skia/ext/platform_device_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/platform_device.cc
diff --git a/skia/ext/platform_device.cc b/skia/ext/platform_device.cc
deleted file mode 100644
index 1a76bc45af5b80c13db1b382ba820e19269fb62f..0000000000000000000000000000000000000000
--- a/skia/ext/platform_device.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/logging.h"
-#include "skia/ext/platform_device.h"
-
-#include "third_party/skia/include/core/SkMetaData.h"
-
-namespace skia {
-
-namespace {
-
-const char* kDevicePlatformBehaviour = "CrDevicePlatformBehaviour";
-const char* kDraftModeKey = "CrDraftMode";
-
-#if defined(OS_MACOSX) || defined(OS_WIN)
-const char* kIsPreviewMetafileKey = "CrIsPreviewMetafile";
-#endif
-
-void SetBoolMetaData(const SkCanvas& canvas, const char* key, bool value) {
- SkMetaData& meta = skia::getMetaData(canvas);
- meta.setBool(key, value);
-}
-
-bool GetBoolMetaData(const SkCanvas& canvas, const char* key) {
- bool value;
- SkMetaData& meta = skia::getMetaData(canvas);
- if (!meta.findBool(key, &value))
- value = false;
- return value;
-}
-
-} // namespace
-
-void SetPlatformDevice(SkBaseDevice* device, PlatformDevice* platform_behaviour) {
- SkMetaData& meta_data = device->getMetaData();
- meta_data.setPtr(kDevicePlatformBehaviour, platform_behaviour);
-}
-
-PlatformDevice* GetPlatformDevice(SkBaseDevice* device) {
- if (device) {
- SkMetaData& meta_data = device->getMetaData();
- PlatformDevice* device_behaviour = NULL;
- if (meta_data.findPtr(kDevicePlatformBehaviour,
- reinterpret_cast<void**>(&device_behaviour)))
- return device_behaviour;
- }
- return NULL;
-}
-
-SkMetaData& getMetaData(const SkCanvas& canvas) {
- SkBaseDevice* device = canvas.getDevice();
- DCHECK(device != NULL);
- return device->getMetaData();
-}
-
-void SetIsDraftMode(const SkCanvas& canvas, bool draft_mode) {
- SetBoolMetaData(canvas, kDraftModeKey, draft_mode);
-}
-
-bool IsDraftMode(const SkCanvas& canvas) {
- return GetBoolMetaData(canvas, kDraftModeKey);
-}
-
-#if defined(OS_MACOSX) || defined(OS_WIN)
-void SetIsPreviewMetafile(const SkCanvas& canvas, bool is_preview) {
- SetBoolMetaData(canvas, kIsPreviewMetafileKey, is_preview);
-}
-
-bool IsPreviewMetafile(const SkCanvas& canvas) {
- return GetBoolMetaData(canvas, kIsPreviewMetafileKey);
-}
-#endif
-
-// For platforms without "platform_device_*" specific files,
-// include default behaviors for necessary methods to compile.
-#if defined(OS_NACL)
-PlatformSurface PlatformDevice::BeginPlatformPaint() {
- return NULL;
-}
-
-void PlatformDevice::EndPlatformPaint() {
- // By default, do nothing here.
-}
-#endif
-
-bool PlatformDevice::SupportsPlatformPaint() {
- return true;
-}
-
-} // namespace skia
« no previous file with comments | « skia/ext/platform_device.h ('k') | skia/ext/platform_device_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698