OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 | 482 |
483 void GraphicsContext::beginRecording(const FloatRect& bounds) | 483 void GraphicsContext::beginRecording(const FloatRect& bounds) |
484 { | 484 { |
485 RefPtr<DisplayList> displayList = adoptRef(new DisplayList(bounds)); | 485 RefPtr<DisplayList> displayList = adoptRef(new DisplayList(bounds)); |
486 | 486 |
487 SkCanvas* savedCanvas = m_canvas; | 487 SkCanvas* savedCanvas = m_canvas; |
488 SkMatrix savedMatrix = getTotalMatrix(); | 488 SkMatrix savedMatrix = getTotalMatrix(); |
489 | 489 |
490 if (!contextDisabled()) { | 490 if (!contextDisabled()) { |
491 IntRect recordingRect = enclosingIntRect(bounds); | 491 IntRect recordingRect = enclosingIntRect(bounds); |
492 m_canvas = displayList->beginRecording(recordingRect.size(), | 492 m_canvas = displayList->beginRecording(recordingRect.size()); |
493 SkPicture::kUsePathBoundsForClip_RecordingFlag); | |
494 | 493 |
495 // We want the bounds offset mapped to (0, 0), such that the display lis
t content | 494 // We want the bounds offset mapped to (0, 0), such that the display lis
t content |
496 // is fully contained within the SkPictureRecord's bounds. | 495 // is fully contained within the SkPictureRecord's bounds. |
497 if (!toFloatSize(bounds.location()).isZero()) { | 496 if (!toFloatSize(bounds.location()).isZero()) { |
498 m_canvas->translate(-bounds.x(), -bounds.y()); | 497 m_canvas->translate(-bounds.x(), -bounds.y()); |
499 // To avoid applying the offset repeatedly in getTotalMatrix(), we p
re-apply it here. | 498 // To avoid applying the offset repeatedly in getTotalMatrix(), we p
re-apply it here. |
500 savedMatrix.preTranslate(bounds.x(), bounds.y()); | 499 savedMatrix.preTranslate(bounds.x(), bounds.y()); |
501 } | 500 } |
502 } | 501 } |
503 | 502 |
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 | 1815 |
1817 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 1816 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
1818 { | 1817 { |
1819 if (m_trackTextRegion) { | 1818 if (m_trackTextRegion) { |
1820 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); | 1819 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); |
1821 m_textRegion.join(textRect); | 1820 m_textRegion.join(textRect); |
1822 } | 1821 } |
1823 } | 1822 } |
1824 | 1823 |
1825 } | 1824 } |
OLD | NEW |