| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 m_hasMetaData(!!metaData) { | 72 m_hasMetaData(!!metaData) { |
| 73 if (metaData) | 73 if (metaData) |
| 74 m_metaData = *metaData; | 74 m_metaData = *metaData; |
| 75 | 75 |
| 76 // FIXME: Do some tests to determine how many states are typically used, and | 76 // FIXME: Do some tests to determine how many states are typically used, and |
| 77 // allocate several here. | 77 // allocate several here. |
| 78 m_paintStateStack.append(GraphicsContextState::create()); | 78 m_paintStateStack.append(GraphicsContextState::create()); |
| 79 m_paintState = m_paintStateStack.back().get(); | 79 m_paintState = m_paintStateStack.back().get(); |
| 80 | 80 |
| 81 if (contextDisabled()) { | 81 if (contextDisabled()) { |
| 82 DEFINE_STATIC_LOCAL(SkCanvas*, nullCanvas, (SkCreateNullCanvas())); | 82 DEFINE_STATIC_LOCAL(SkCanvas*, nullCanvas, (SkMakeNullCanvas().release())); |
| 83 m_canvas = nullCanvas; | 83 m_canvas = nullCanvas; |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 GraphicsContext::~GraphicsContext() { | 87 GraphicsContext::~GraphicsContext() { |
| 88 #if DCHECK_IS_ON() | 88 #if DCHECK_IS_ON() |
| 89 if (!m_disableDestructionChecks) { | 89 if (!m_disableDestructionChecks) { |
| 90 ASSERT(!m_paintStateIndex); | 90 ASSERT(!m_paintStateIndex); |
| 91 ASSERT(!m_paintState->saveCount()); | 91 ASSERT(!m_paintState->saveCount()); |
| 92 ASSERT(!m_layerCount); | 92 ASSERT(!m_layerCount); |
| (...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 static const SkPMColor colors[] = { | 1408 static const SkPMColor colors[] = { |
| 1409 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red | 1409 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red |
| 1410 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray | 1410 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray |
| 1411 }; | 1411 }; |
| 1412 | 1412 |
| 1413 return colors[index]; | 1413 return colors[index]; |
| 1414 } | 1414 } |
| 1415 #endif | 1415 #endif |
| 1416 | 1416 |
| 1417 } // namespace blink | 1417 } // namespace blink |
| OLD | NEW |