OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 return m_state->m_fillColor; | 371 return m_state->m_fillColor; |
372 } | 372 } |
373 | 373 |
374 void PlatformContextSkia::beginPath() | 374 void PlatformContextSkia::beginPath() |
375 { | 375 { |
376 m_path.reset(); | 376 m_path.reset(); |
377 } | 377 } |
378 | 378 |
379 void PlatformContextSkia::addPath(const SkPath& path) | 379 void PlatformContextSkia::addPath(const SkPath& path) |
380 { | 380 { |
381 m_path.addPath(path); | 381 m_path.addPath(path, m_canvas->getTotalMatrix()); |
| 382 } |
| 383 |
| 384 SkPath PlatformContextSkia::currentPathInLocalCoordinates() const { |
| 385 SkPath local_path = m_path; |
| 386 const SkMatrix& matrix = m_canvas->getTotalMatrix(); |
| 387 SkMatrix inverse_matrix; |
| 388 matrix.invert(&inverse_matrix); |
| 389 local_path.transform(inverse_matrix); |
| 390 return local_path; |
382 } | 391 } |
383 | 392 |
384 void PlatformContextSkia::setFillRule(SkPath::FillType fr) | 393 void PlatformContextSkia::setFillRule(SkPath::FillType fr) |
385 { | 394 { |
386 m_path.setFillType(fr); | 395 m_path.setFillType(fr); |
387 } | 396 } |
388 | 397 |
389 void PlatformContextSkia::setGradient(SkShader* gradient) | 398 void PlatformContextSkia::setGradient(SkShader* gradient) |
390 { | 399 { |
391 if (gradient != m_state->m_gradient) { | 400 if (gradient != m_state->m_gradient) { |
(...skipping 26 matching lines...) Expand all Loading... |
418 | 427 |
419 const SkBitmap* PlatformContextSkia::bitmap() const | 428 const SkBitmap* PlatformContextSkia::bitmap() const |
420 { | 429 { |
421 return &m_canvas->getDevice()->accessBitmap(false); | 430 return &m_canvas->getDevice()->accessBitmap(false); |
422 } | 431 } |
423 | 432 |
424 bool PlatformContextSkia::isPrinting() | 433 bool PlatformContextSkia::isPrinting() |
425 { | 434 { |
426 return m_canvas->getTopPlatformDevice().IsVectorial(); | 435 return m_canvas->getTopPlatformDevice().IsVectorial(); |
427 } | 436 } |
OLD | NEW |