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

Unified Diff: printing/native_metafile_skia_wrapper.cc

Issue 6826027: Connect the right metafiles for print preview on Linux and Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile problems Created 9 years, 8 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 | « printing/native_metafile_skia_wrapper.h ('k') | printing/pdf_metafile_cairo_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/native_metafile_skia_wrapper.cc
diff --git a/printing/native_metafile_skia_wrapper.cc b/printing/native_metafile_skia_wrapper.cc
deleted file mode 100644
index 38de9dfde49e36483e70a4c4eb58c5ebe2fa5af0..0000000000000000000000000000000000000000
--- a/printing/native_metafile_skia_wrapper.cc
+++ /dev/null
@@ -1,55 +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 "printing/native_metafile_skia_wrapper.h"
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkDevice.h"
-#include "third_party/skia/include/core/SkMetaData.h"
-
-namespace printing {
-
-namespace {
-
-static const char* kNativeMetafileKey = "CrNativeMetafile";
-
-SkMetaData& getMetaData(SkCanvas* canvas) {
- DCHECK(canvas != NULL);
-
- SkDevice* device = canvas->getDevice();
- DCHECK(device != NULL);
- return device->getMetaData();
-}
-
-} // namespace
-
-
-// static
-void NativeMetafileSkiaWrapper::SetMetafileOnCanvas(SkCanvas* canvas,
- NativeMetafile* metafile) {
- NativeMetafileSkiaWrapper* wrapper = NULL;
- if (metafile)
- wrapper = new NativeMetafileSkiaWrapper(metafile);
-
- SkMetaData& meta = getMetaData(canvas);
- meta.setRefCnt(kNativeMetafileKey, wrapper);
- SkSafeUnref(wrapper);
-}
-
-// static
-NativeMetafile* NativeMetafileSkiaWrapper::GetMetafileFromCanvas(
- SkCanvas* canvas) {
- SkMetaData& meta = getMetaData(canvas);
- SkRefCnt* value;
- if (!meta.findRefCnt(kNativeMetafileKey, &value) || !value)
- return NULL;
-
- return static_cast<NativeMetafileSkiaWrapper*>(value)->metafile_;
-}
-
-NativeMetafileSkiaWrapper::NativeMetafileSkiaWrapper(NativeMetafile* metafile)
- : metafile_(metafile) {
-}
-
-} // namespace printing
« no previous file with comments | « printing/native_metafile_skia_wrapper.h ('k') | printing/pdf_metafile_cairo_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698