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 17 matching lines...) Expand all Loading... |
28 #include "platform/graphics/GraphicsContext.h" | 28 #include "platform/graphics/GraphicsContext.h" |
29 | 29 |
30 #include "platform/TraceEvent.h" | 30 #include "platform/TraceEvent.h" |
31 #include "platform/geometry/IntRect.h" | 31 #include "platform/geometry/IntRect.h" |
32 #include "platform/graphics/ColorSpace.h" | 32 #include "platform/graphics/ColorSpace.h" |
33 #include "platform/graphics/Gradient.h" | 33 #include "platform/graphics/Gradient.h" |
34 #include "platform/graphics/GraphicsContextStateSaver.h" | 34 #include "platform/graphics/GraphicsContextStateSaver.h" |
35 #include "platform/graphics/ImageBuffer.h" | 35 #include "platform/graphics/ImageBuffer.h" |
36 #include "platform/graphics/paint/PaintController.h" | 36 #include "platform/graphics/paint/PaintController.h" |
37 #include "platform/weborigin/KURL.h" | 37 #include "platform/weborigin/KURL.h" |
38 #include "skia/ext/platform_device.h" | 38 #include "skia/ext/platform_canvas.h" |
39 #include "third_party/skia/include/core/SkAnnotation.h" | 39 #include "third_party/skia/include/core/SkAnnotation.h" |
40 #include "third_party/skia/include/core/SkColorFilter.h" | 40 #include "third_party/skia/include/core/SkColorFilter.h" |
41 #include "third_party/skia/include/core/SkData.h" | 41 #include "third_party/skia/include/core/SkData.h" |
42 #include "third_party/skia/include/core/SkPicture.h" | 42 #include "third_party/skia/include/core/SkPicture.h" |
43 #include "third_party/skia/include/core/SkPictureRecorder.h" | 43 #include "third_party/skia/include/core/SkPictureRecorder.h" |
44 #include "third_party/skia/include/core/SkRRect.h" | 44 #include "third_party/skia/include/core/SkRRect.h" |
45 #include "third_party/skia/include/core/SkRefCnt.h" | 45 #include "third_party/skia/include/core/SkRefCnt.h" |
46 #include "third_party/skia/include/effects/SkLumaColorFilter.h" | 46 #include "third_party/skia/include/effects/SkLumaColorFilter.h" |
47 #include "third_party/skia/include/effects/SkPictureImageFilter.h" | 47 #include "third_party/skia/include/effects/SkPictureImageFilter.h" |
48 #include "third_party/skia/include/utils/SkNullCanvas.h" | 48 #include "third_party/skia/include/utils/SkNullCanvas.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 ASSERT(m_layerCount-- > 0); | 294 ASSERT(m_layerCount-- > 0); |
295 } | 295 } |
296 | 296 |
297 void GraphicsContext::beginRecording(const FloatRect& bounds) | 297 void GraphicsContext::beginRecording(const FloatRect& bounds) |
298 { | 298 { |
299 if (contextDisabled()) | 299 if (contextDisabled()) |
300 return; | 300 return; |
301 | 301 |
302 m_canvas = m_pictureRecorder.beginRecording(bounds, 0); | 302 m_canvas = m_pictureRecorder.beginRecording(bounds, 0); |
303 if (m_hasMetaData) | 303 if (m_hasMetaData) |
304 skia::getMetaData(*m_canvas) = m_metaData; | 304 skia::GetMetaData(*m_canvas) = m_metaData; |
305 } | 305 } |
306 | 306 |
307 PassRefPtr<const SkPicture> GraphicsContext::endRecording() | 307 PassRefPtr<const SkPicture> GraphicsContext::endRecording() |
308 { | 308 { |
309 if (contextDisabled()) | 309 if (contextDisabled()) |
310 return nullptr; | 310 return nullptr; |
311 | 311 |
312 RefPtr<const SkPicture> picture = adoptRef(m_pictureRecorder.endRecordingAsP
icture()); | 312 RefPtr<const SkPicture> picture = adoptRef(m_pictureRecorder.endRecordingAsP
icture()); |
313 m_canvas = m_originalCanvas; | 313 m_canvas = m_originalCanvas; |
314 ASSERT(picture); | 314 ASSERT(picture); |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 static const SkPMColor colors[] = { | 1344 static const SkPMColor colors[] = { |
1345 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red | 1345 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red |
1346 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray | 1346 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray |
1347 }; | 1347 }; |
1348 | 1348 |
1349 return colors[index]; | 1349 return colors[index]; |
1350 } | 1350 } |
1351 #endif | 1351 #endif |
1352 | 1352 |
1353 } // namespace blink | 1353 } // namespace blink |
OLD | NEW |