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

Unified Diff: chrome/renderer/print_web_view_helper_linux.cc

Issue 11418217: Add skia::RefPtr class to wrap ref counted classes from Skia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop TNoRef Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/print_web_view_helper_linux.cc
diff --git a/chrome/renderer/print_web_view_helper_linux.cc b/chrome/renderer/print_web_view_helper_linux.cc
index f1ec86550ee3cea6c5cb5569de31050bae54bb05..5235cc5fddea80e0c658c04dfd4a6bc7868daa26 100644
--- a/chrome/renderer/print_web_view_helper_linux.cc
+++ b/chrome/renderer/print_web_view_helper_linux.cc
@@ -15,8 +15,8 @@
#include "printing/metafile_skia_wrapper.h"
#include "printing/page_size_margins.h"
#include "skia/ext/platform_device.h"
+#include "skia/ext/refptr.h"
#include "skia/ext/vector_canvas.h"
-#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#if !defined(OS_CHROMEOS)
@@ -187,15 +187,14 @@ void PrintWebViewHelper::PrintPageInternal(
gfx::Rect canvas_area =
params.params.display_header_footer ? gfx::Rect(page_size) : content_area;
- SkDevice* device = metafile->StartPageForVectorCanvas(page_size, canvas_area,
- scale_factor);
+ skia::RefPtr<SkDevice> device = metafile->StartPageForVectorCanvas(
+ page_size, canvas_area, scale_factor);
if (!device)
return;
// The printPage method take a reference to the canvas we pass down, so it
// can't be a stack object.
- SkRefPtr<skia::VectorCanvas> canvas = new skia::VectorCanvas(device);
- canvas->unref(); // SkRefPtr and new both took a reference.
+ skia::RefPtr<skia::VectorCanvas> canvas = new skia::VectorCanvas(device);
printing::MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_);

Powered by Google App Engine
This is Rietveld 408576698