| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include <memory> | 52 #include <memory> |
| 53 | 53 |
| 54 namespace blink { | 54 namespace blink { |
| 55 | 55 |
| 56 GraphicsContext::GraphicsContext(PaintController& paintController, | 56 GraphicsContext::GraphicsContext(PaintController& paintController, |
| 57 DisabledMode disableContextOrPainting, | 57 DisabledMode disableContextOrPainting, |
| 58 SkMetaData* metaData) | 58 SkMetaData* metaData) |
| 59 : m_canvas(nullptr), | 59 : m_canvas(nullptr), |
| 60 m_paintController(paintController), | 60 m_paintController(paintController), |
| 61 m_paintStateStack(), | 61 m_paintStateStack(), |
| 62 m_paintStateIndex(0) | 62 m_paintStateIndex(0), |
| 63 #if DCHECK_IS_ON() | 63 #if DCHECK_IS_ON() |
| 64 , | |
| 65 m_layerCount(0), | 64 m_layerCount(0), |
| 66 m_disableDestructionChecks(false), | 65 m_disableDestructionChecks(false), |
| 67 m_inDrawingRecorder(false) | 66 m_inDrawingRecorder(false), |
| 68 #endif | 67 #endif |
| 69 , | |
| 70 m_disabledState(disableContextOrPainting), | 68 m_disabledState(disableContextOrPainting), |
| 71 m_deviceScaleFactor(1.0f), | 69 m_deviceScaleFactor(1.0f), |
| 72 m_printing(false), | 70 m_printing(false), |
| 73 m_hasMetaData(!!metaData) { | 71 m_hasMetaData(!!metaData) { |
| 74 if (metaData) | 72 if (metaData) |
| 75 m_metaData = *metaData; | 73 m_metaData = *metaData; |
| 76 | 74 |
| 77 // FIXME: Do some tests to determine how many states are typically used, and a
llocate | 75 // FIXME: Do some tests to determine how many states are typically used, and a
llocate |
| 78 // several here. | 76 // several here. |
| 79 m_paintStateStack.append(GraphicsContextState::create()); | 77 m_paintStateStack.append(GraphicsContextState::create()); |
| (...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 static const SkPMColor colors[] = { | 1405 static const SkPMColor colors[] = { |
| 1408 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red | 1406 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red |
| 1409 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray | 1407 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray |
| 1410 }; | 1408 }; |
| 1411 | 1409 |
| 1412 return colors[index]; | 1410 return colors[index]; |
| 1413 } | 1411 } |
| 1414 #endif | 1412 #endif |
| 1415 | 1413 |
| 1416 } // namespace blink | 1414 } // namespace blink |
| OLD | NEW |