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

Side by Side Diff: printing/pdf_metafile_cairo_linux.cc

Issue 7019013: Removal of dependencies on PlatformDevice classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Syncing merge conflicts. Created 9 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « printing/pdf_metafile_cairo_linux.h ('k') | printing/pdf_metafile_cg_mac.h » ('j') | 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 "printing/pdf_metafile_cairo_linux.h" 5 #include "printing/pdf_metafile_cairo_linux.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <cairo.h> 9 #include <cairo.h>
10 #include <cairo-pdf.h> 10 #include <cairo-pdf.h>
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 uint32 src_buffer_size) { 111 uint32 src_buffer_size) {
112 if (src_buffer == NULL || src_buffer_size == 0) 112 if (src_buffer == NULL || src_buffer_size == 0)
113 return false; 113 return false;
114 114
115 raw_data_ = std::string(reinterpret_cast<const char*>(src_buffer), 115 raw_data_ = std::string(reinterpret_cast<const char*>(src_buffer),
116 src_buffer_size); 116 src_buffer_size);
117 current_data_ = &raw_data_; 117 current_data_ = &raw_data_;
118 return true; 118 return true;
119 } 119 }
120 120
121 skia::PlatformDevice* PdfMetafileCairo::StartPageForVectorCanvas( 121 SkDevice* PdfMetafileCairo::StartPageForVectorCanvas(
122 const gfx::Size& page_size, const gfx::Rect& content_area, 122 const gfx::Size& page_size, const gfx::Rect& content_area,
123 const float& scale_factor) { 123 const float& scale_factor) {
124 if (!StartPage(page_size, content_area, scale_factor)) 124 if (!StartPage(page_size, content_area, scale_factor))
125 return NULL; 125 return NULL;
126 126
127 return skia::VectorPlatformDeviceCairoFactory::CreateDevice( 127 return skia::VectorPlatformDeviceCairoFactory::CreateDevice(
128 context_, page_size.width(), page_size.height(), true); 128 context_, page_size.width(), page_size.height(), true);
129 } 129 }
130 130
131 bool PdfMetafileCairo::StartPage(const gfx::Size& page_size, 131 bool PdfMetafileCairo::StartPage(const gfx::Size& page_size,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 void PdfMetafileCairo::CleanUpAll() { 251 void PdfMetafileCairo::CleanUpAll() {
252 CleanUpContext(&context_); 252 CleanUpContext(&context_);
253 CleanUpSurface(&surface_); 253 CleanUpSurface(&surface_);
254 cairo_data_.clear(); 254 cairo_data_.clear();
255 raw_data_.clear(); 255 raw_data_.clear();
256 skia::VectorPlatformDeviceCairo::ClearFontCache(); 256 skia::VectorPlatformDeviceCairo::ClearFontCache();
257 } 257 }
258 258
259 } // namespace printing 259 } // namespace printing
OLDNEW
« no previous file with comments | « printing/pdf_metafile_cairo_linux.h ('k') | printing/pdf_metafile_cg_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698