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

Side by Side Diff: printing/pdf_metafile_cairo_linux.cc

Issue 7273013: Stop using deprecated factory API for SkDevice (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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/emf_win.cc ('k') | skia/ext/bitmap_platform_device_linux.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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 current_data_ = &raw_data_; 117 current_data_ = &raw_data_;
118 return true; 118 return true;
119 } 119 }
120 120
121 SkDevice* 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::VectorPlatformDeviceCairo::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,
132 const gfx::Rect& content_area, 132 const gfx::Rect& content_area,
133 const float& scale_factor) { 133 const float& scale_factor) {
134 DCHECK(IsSurfaceValid(surface_)); 134 DCHECK(IsSurfaceValid(surface_));
135 DCHECK(IsContextValid(context_)); 135 DCHECK(IsContextValid(context_));
136 // Passing this check implies page_surface_ is NULL, and current_page_ is 136 // Passing this check implies page_surface_ is NULL, and current_page_ is
137 // empty. 137 // empty.
(...skipping 112 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/emf_win.cc ('k') | skia/ext/bitmap_platform_device_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698