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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 // FIXME: Do some tests to determine how many states are typically used, and
allocate | 139 // FIXME: Do some tests to determine how many states are typically used, and
allocate |
140 // several here. | 140 // several here. |
141 m_paintStateStack.append(GraphicsContextState::create()); | 141 m_paintStateStack.append(GraphicsContextState::create()); |
142 m_paintState = m_paintStateStack.last().get(); | 142 m_paintState = m_paintStateStack.last().get(); |
143 } | 143 } |
144 | 144 |
145 GraphicsContext::~GraphicsContext() | 145 GraphicsContext::~GraphicsContext() |
146 { | 146 { |
147 #if !ENABLE(OILPAN) | 147 #if !ENABLE(OILPAN) |
148 // These asserts are only valid in debug mode and therefore do not seem | 148 // FIXME: Oilpan: These asserts are not true for |
149 // useful. We cannot rely on them in any case. With Oilpan we cannot run | 149 // CanvasRenderingContext2D. Therefore, there is debug mode code |
150 // the debug mode only code in CanvasRendingContext2D's destructor which | 150 // in the CanvasRenderingContext2D that forces this to be true so |
151 // touches other objects that are dead. Therefore, we disable these asserts | 151 // that the assertions can be here for all the other cases. With |
152 // with Oilpan and should probably consider just disabling them. | 152 // Oilpan we cannot run that code in the CanvasRenderingContext2D |
| 153 // destructor because it touches other objects that are already |
| 154 // dead. We need to find another way of doing these asserts when |
| 155 // Oilpan is enabled. |
153 ASSERT(!m_paintStateIndex); | 156 ASSERT(!m_paintStateIndex); |
154 ASSERT(!m_paintState->saveCount()); | 157 ASSERT(!m_paintState->saveCount()); |
155 ASSERT(!m_annotationCount); | 158 ASSERT(!m_annotationCount); |
156 ASSERT(!m_layerCount); | 159 ASSERT(!m_layerCount); |
157 ASSERT(m_recordingStateStack.isEmpty()); | 160 ASSERT(m_recordingStateStack.isEmpty()); |
158 #endif | 161 #endif |
159 } | 162 } |
160 | 163 |
161 void GraphicsContext::save() | 164 void GraphicsContext::save() |
162 { | 165 { |
(...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1844 | 1847 |
1845 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 1848 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
1846 { | 1849 { |
1847 if (m_trackTextRegion) { | 1850 if (m_trackTextRegion) { |
1848 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); | 1851 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); |
1849 m_textRegion.join(textRect); | 1852 m_textRegion.join(textRect); |
1850 } | 1853 } |
1851 } | 1854 } |
1852 | 1855 |
1853 } | 1856 } |
OLD | NEW |