OLD | NEW |
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 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2240 "Could not set layer transform."); | 2240 "Could not set layer transform."); |
2241 | 2241 |
2242 //Get the current visual collection and add the layer to it. | 2242 //Get the current visual collection and add the layer to it. |
2243 SkTScopedComPtr<IXpsOMVisualCollection> currentVisuals; | 2243 SkTScopedComPtr<IXpsOMVisualCollection> currentVisuals; |
2244 HRVM(this->fCurrentXpsCanvas->GetVisuals(¤tVisuals), | 2244 HRVM(this->fCurrentXpsCanvas->GetVisuals(¤tVisuals), |
2245 "Could not get current visuals for layer."); | 2245 "Could not get current visuals for layer."); |
2246 HRVM(currentVisuals->Append(that->fCurrentXpsCanvas.get()), | 2246 HRVM(currentVisuals->Append(that->fCurrentXpsCanvas.get()), |
2247 "Could not add layer to current visuals."); | 2247 "Could not add layer to current visuals."); |
2248 } | 2248 } |
2249 | 2249 |
2250 SkBaseDevice* SkXPSDevice::onCreateDevice(const SkImageInfo&, Usage) { | 2250 SkBaseDevice* SkXPSDevice::onCreateCompatibleDevice(const CreateInfo& info) { |
2251 //Conditional for bug compatibility with PDF device. | 2251 //Conditional for bug compatibility with PDF device. |
2252 #if 0 | 2252 #if 0 |
2253 if (SkBaseDevice::kGeneral_Usage == usage) { | 2253 if (SkBaseDevice::kGeneral_Usage == info.fUsage) { |
2254 return NULL; | 2254 return NULL; |
2255 SK_CRASH(); | 2255 SK_CRASH(); |
2256 //To what stream do we write? | 2256 //To what stream do we write? |
2257 //SkXPSDevice* dev = new SkXPSDevice(this); | 2257 //SkXPSDevice* dev = new SkXPSDevice(this); |
2258 //SkSize s = SkSize::Make(width, height); | 2258 //SkSize s = SkSize::Make(width, height); |
2259 //dev->BeginCanvas(s, s, SkMatrix::I()); | 2259 //dev->BeginCanvas(s, s, SkMatrix::I()); |
2260 //return dev; | 2260 //return dev; |
2261 } | 2261 } |
2262 #endif | 2262 #endif |
2263 return new SkXPSDevice(this->fXpsFactory.get()); | 2263 return new SkXPSDevice(this->fXpsFactory.get()); |
(...skipping 10 matching lines...) Expand all Loading... |
2274 IID_PPV_ARGS(&this->fXpsFactory)), | 2274 IID_PPV_ARGS(&this->fXpsFactory)), |
2275 "Could not create factory for layer."); | 2275 "Could not create factory for layer."); |
2276 | 2276 |
2277 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), | 2277 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), |
2278 "Could not create canvas for layer."); | 2278 "Could not create canvas for layer."); |
2279 } | 2279 } |
2280 | 2280 |
2281 bool SkXPSDevice::allowImageFilter(const SkImageFilter*) { | 2281 bool SkXPSDevice::allowImageFilter(const SkImageFilter*) { |
2282 return false; | 2282 return false; |
2283 } | 2283 } |
OLD | NEW |