Chromium Code Reviews| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 , m_antialiasHairlineImages(false) | 133 , m_antialiasHairlineImages(false) |
| 134 { | 134 { |
| 135 // FIXME: Do some tests to determine how many states are typically used, and allocate | 135 // FIXME: Do some tests to determine how many states are typically used, and allocate |
| 136 // several here. | 136 // several here. |
| 137 m_paintStateStack.append(GraphicsContextState::create()); | 137 m_paintStateStack.append(GraphicsContextState::create()); |
| 138 m_paintState = m_paintStateStack.last().get(); | 138 m_paintState = m_paintStateStack.last().get(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 GraphicsContext::~GraphicsContext() | 141 GraphicsContext::~GraphicsContext() |
| 142 { | 142 { |
| 143 #if !ENABLE(OILPAN) | |
| 144 // These asserts are only valid in debug mode and therefore do not seem | |
| 145 // useful. We cannot rely on them in any case. With Oilpan we cannot run | |
|
haraken
2014/04/24 04:18:43
Nit: I'd drop the first two sentences. These asser
Mads Ager (chromium)
2014/04/24 10:57:36
I do want the first two sentences here. This code
| |
| 146 // the debug mode only code in CanvasRendingContext2D's destructor which | |
|
haraken
2014/04/24 04:18:43
we cannot run CanvasRendingContext2D's destructor
Mads Ager (chromium)
2014/04/24 10:57:36
We can run the destructor. But we cannot run the d
| |
| 147 // touches other objects that are dead. Therefore, we disable these asserts | |
| 148 // with Oilpan and should probably consider just disabling them. | |
| 143 ASSERT(!m_paintStateIndex); | 149 ASSERT(!m_paintStateIndex); |
| 144 ASSERT(!m_paintState->saveCount()); | 150 ASSERT(!m_paintState->saveCount()); |
| 145 ASSERT(!m_annotationCount); | 151 ASSERT(!m_annotationCount); |
| 146 ASSERT(!m_layerCount); | 152 ASSERT(!m_layerCount); |
| 147 ASSERT(m_recordingStateStack.isEmpty()); | 153 ASSERT(m_recordingStateStack.isEmpty()); |
| 154 #endif | |
| 148 } | 155 } |
| 149 | 156 |
| 150 void GraphicsContext::save() | 157 void GraphicsContext::save() |
| 151 { | 158 { |
| 152 if (paintingDisabled()) | 159 if (paintingDisabled()) |
| 153 return; | 160 return; |
| 154 | 161 |
| 155 m_paintState->incrementSaveCount(); | 162 m_paintState->incrementSaveCount(); |
| 156 | 163 |
| 157 m_canvasStateStack.append(CanvasSaveState(m_pendingCanvasSave, m_canvas->get SaveCount())); | 164 m_canvasStateStack.append(CanvasSaveState(m_pendingCanvasSave, m_canvas->get SaveCount())); |
| (...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1885 | 1892 |
| 1886 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 1893 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
| 1887 { | 1894 { |
| 1888 if (m_trackTextRegion) { | 1895 if (m_trackTextRegion) { |
| 1889 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); | 1896 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); |
| 1890 m_textRegion.join(textRect); | 1897 m_textRegion.join(textRect); |
| 1891 } | 1898 } |
| 1892 } | 1899 } |
| 1893 | 1900 |
| 1894 } | 1901 } |
| OLD | NEW |