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 |
| 146 // the debug mode only code in CanvasRendingContext2D's destructor which |
| 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 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 | 1882 |
1876 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 1883 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
1877 { | 1884 { |
1878 if (m_trackTextRegion) { | 1885 if (m_trackTextRegion) { |
1879 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); | 1886 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); |
1880 m_textRegion.join(textRect); | 1887 m_textRegion.join(textRect); |
1881 } | 1888 } |
1882 } | 1889 } |
1883 | 1890 |
1884 } | 1891 } |
OLD | NEW |