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

Side by Side Diff: src/device/xps/SkXPSDevice.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Moved code around to make code review easier Created 7 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef UNICODE 8 #ifndef UNICODE
9 #define UNICODE 9 #define UNICODE
10 #endif 10 #endif
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return S_OK; 104 return S_OK;
105 } 105 }
106 106
107 static SkBitmap make_fake_bitmap(int width, int height) { 107 static SkBitmap make_fake_bitmap(int width, int height) {
108 SkBitmap bitmap; 108 SkBitmap bitmap;
109 bitmap.setConfig(SkBitmap::kNo_Config, width, height); 109 bitmap.setConfig(SkBitmap::kNo_Config, width, height);
110 return bitmap; 110 return bitmap;
111 } 111 }
112 112
113 SkXPSDevice::SkXPSDevice() 113 SkXPSDevice::SkXPSDevice()
114 : SkDevice(make_fake_bitmap(10000, 10000)) 114 : SkRasterDevice(make_fake_bitmap(10000, 10000))
115 , fCurrentPage(0) { 115 , fCurrentPage(0) {
116 } 116 }
117 117
118 SkXPSDevice::~SkXPSDevice() { 118 SkXPSDevice::~SkXPSDevice() {
119 } 119 }
120 120
121 SkXPSDevice::TypefaceUse::TypefaceUse() 121 SkXPSDevice::TypefaceUse::TypefaceUse()
122 : typefaceId(0xffffffff) 122 : typefaceId(0xffffffff)
123 , fontData(NULL) 123 , fontData(NULL)
124 , xpsFont(NULL) 124 , xpsFont(NULL)
(...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2418 //SkXPSDevice* dev = new SkXPSDevice(this); 2418 //SkXPSDevice* dev = new SkXPSDevice(this);
2419 //SkSize s = SkSize::Make(width, height); 2419 //SkSize s = SkSize::Make(width, height);
2420 //dev->BeginCanvas(s, s, SkMatrix::I()); 2420 //dev->BeginCanvas(s, s, SkMatrix::I());
2421 //return dev; 2421 //return dev;
2422 } 2422 }
2423 2423
2424 return new SkXPSDevice(this->fXpsFactory.get()); 2424 return new SkXPSDevice(this->fXpsFactory.get());
2425 } 2425 }
2426 2426
2427 SkXPSDevice::SkXPSDevice(IXpsOMObjectFactory* xpsFactory) 2427 SkXPSDevice::SkXPSDevice(IXpsOMObjectFactory* xpsFactory)
2428 : SkDevice(make_fake_bitmap(10000, 10000)) 2428 : SkRasterDevice(make_fake_bitmap(10000, 10000))
2429 , fCurrentPage(0) { 2429 , fCurrentPage(0) {
2430 2430
2431 HRVM(CoCreateInstance( 2431 HRVM(CoCreateInstance(
2432 CLSID_XpsOMObjectFactory, 2432 CLSID_XpsOMObjectFactory,
2433 NULL, 2433 NULL,
2434 CLSCTX_INPROC_SERVER, 2434 CLSCTX_INPROC_SERVER,
2435 IID_PPV_ARGS(&this->fXpsFactory)), 2435 IID_PPV_ARGS(&this->fXpsFactory)),
2436 "Could not create factory for layer."); 2436 "Could not create factory for layer.");
2437 2437
2438 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), 2438 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas),
2439 "Could not create canvas for layer."); 2439 "Could not create canvas for layer.");
2440 } 2440 }
2441 2441
2442 bool SkXPSDevice::allowImageFilter(SkImageFilter*) { 2442 bool SkXPSDevice::allowImageFilter(SkImageFilter*) {
2443 return false; 2443 return false;
2444 } 2444 }
OLDNEW
« include/core/SkDevice.h ('K') | « src/core/SkPicture.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698