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 #include "SkTypes.h" | 8 #include "SkTypes.h" |
9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
10 | 10 |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 static const XPS_TILE_MODE XTM_T = XPS_TILE_MODE_TILE; | 637 static const XPS_TILE_MODE XTM_T = XPS_TILE_MODE_TILE; |
638 static const XPS_TILE_MODE XTM_X = XPS_TILE_MODE_FLIPX; | 638 static const XPS_TILE_MODE XTM_X = XPS_TILE_MODE_FLIPX; |
639 static const XPS_TILE_MODE XTM_Y = XPS_TILE_MODE_FLIPY; | 639 static const XPS_TILE_MODE XTM_Y = XPS_TILE_MODE_FLIPY; |
640 static const XPS_TILE_MODE XTM_XY = XPS_TILE_MODE_FLIPXY; | 640 static const XPS_TILE_MODE XTM_XY = XPS_TILE_MODE_FLIPXY; |
641 | 641 |
642 //TODO(bungeman): In the future, should skia add None, | 642 //TODO(bungeman): In the future, should skia add None, |
643 //handle None+Mirror and None+Repeat correctly. | 643 //handle None+Mirror and None+Repeat correctly. |
644 //None is currently an internal hack so masks don't repeat (None+None only). | 644 //None is currently an internal hack so masks don't repeat (None+None only). |
645 static XPS_TILE_MODE SkToXpsTileMode[SkShader::kTileModeCount+1] | 645 static XPS_TILE_MODE SkToXpsTileMode[SkShader::kTileModeCount+1] |
646 [SkShader::kTileModeCount+1] = { | 646 [SkShader::kTileModeCount+1] = { |
647 //Clamp //Repeat //Mirror //None | 647 //Clamp //Repeat //Mirror //None |
648 /*Clamp */ XTM_N, XTM_T, XTM_Y, XTM_N, | 648 /*Clamp */ {XTM_N, XTM_T, XTM_Y, XTM_N}, |
649 /*Repeat*/ XTM_T, XTM_T, XTM_Y, XTM_N, | 649 /*Repeat*/ {XTM_T, XTM_T, XTM_Y, XTM_N}, |
650 /*Mirror*/ XTM_X, XTM_X, XTM_XY, XTM_X, | 650 /*Mirror*/ {XTM_X, XTM_X, XTM_XY, XTM_X}, |
651 /*None */ XTM_N, XTM_N, XTM_Y, XTM_N, | 651 /*None */ {XTM_N, XTM_N, XTM_Y, XTM_N}, |
652 }; | 652 }; |
653 | 653 |
654 HRESULT SkXPSDevice::createXpsImageBrush( | 654 HRESULT SkXPSDevice::createXpsImageBrush( |
655 const SkBitmap& bitmap, | 655 const SkBitmap& bitmap, |
656 const SkMatrix& localMatrix, | 656 const SkMatrix& localMatrix, |
657 const SkShader::TileMode (&xy)[2], | 657 const SkShader::TileMode (&xy)[2], |
658 const SkAlpha alpha, | 658 const SkAlpha alpha, |
659 IXpsOMTileBrush** xpsBrush) { | 659 IXpsOMTileBrush** xpsBrush) { |
660 SkDynamicMemoryWStream write; | 660 SkDynamicMemoryWStream write; |
661 if (!SkImageEncoder::EncodeStream(&write, bitmap, | 661 if (!SkImageEncoder::EncodeStream(&write, bitmap, |
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2279 //SkXPSDevice* dev = new SkXPSDevice(this); | 2279 //SkXPSDevice* dev = new SkXPSDevice(this); |
2280 //SkSize s = SkSize::Make(width, height); | 2280 //SkSize s = SkSize::Make(width, height); |
2281 //dev->BeginCanvas(s, s, SkMatrix::I()); | 2281 //dev->BeginCanvas(s, s, SkMatrix::I()); |
2282 //return dev; | 2282 //return dev; |
2283 } | 2283 } |
2284 #endif | 2284 #endif |
2285 return new SkXPSDevice(this->fXpsFactory.get()); | 2285 return new SkXPSDevice(this->fXpsFactory.get()); |
2286 } | 2286 } |
2287 | 2287 |
2288 #endif//defined(SK_BUILD_FOR_WIN32) | 2288 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |