OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012, Google Inc. All rights reserved. | 2 * Copyright (c) 2012, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 void OpaqueRegionSkia::pushCanvasLayer(const SkPaint* paint) | 175 void OpaqueRegionSkia::pushCanvasLayer(const SkPaint* paint) |
176 { | 176 { |
177 CanvasLayerState state; | 177 CanvasLayerState state; |
178 if (paint) | 178 if (paint) |
179 state.paint = *paint; | 179 state.paint = *paint; |
180 m_canvasLayerStack.append(state); | 180 m_canvasLayerStack.append(state); |
181 } | 181 } |
182 | 182 |
183 void OpaqueRegionSkia::popCanvasLayer(const PlatformContextSkia* context) | 183 void OpaqueRegionSkia::popCanvasLayer(const PlatformContextSkia* context) |
184 { | 184 { |
| 185 ASSERT(!m_canvasLayerStack.isEmpty()); |
| 186 if (m_canvasLayerStack.isEmpty()) |
| 187 return; |
| 188 |
185 const CanvasLayerState& canvasLayer = m_canvasLayerStack.last(); | 189 const CanvasLayerState& canvasLayer = m_canvasLayerStack.last(); |
186 SkRect layerOpaqueRect = canvasLayer.opaqueRect; | 190 SkRect layerOpaqueRect = canvasLayer.opaqueRect; |
187 SkPaint layerPaint = canvasLayer.paint; | 191 SkPaint layerPaint = canvasLayer.paint; |
188 | 192 |
189 // Apply the image mask. | 193 // Apply the image mask. |
190 if (canvasLayer.hasImageMask && !layerOpaqueRect.intersect(canvasLayer.image
OpaqueRect)) | 194 if (canvasLayer.hasImageMask && !layerOpaqueRect.intersect(canvasLayer.image
OpaqueRect)) |
191 layerOpaqueRect.setEmpty(); | 195 layerOpaqueRect.setEmpty(); |
192 | 196 |
193 m_canvasLayerStack.removeLast(); | 197 m_canvasLayerStack.removeLast(); |
194 | 198 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 opaqueRect = vertical; | 430 opaqueRect = vertical; |
427 } | 431 } |
428 | 432 |
429 void OpaqueRegionSkia::markAllAsNonOpaque() | 433 void OpaqueRegionSkia::markAllAsNonOpaque() |
430 { | 434 { |
431 SkRect& opaqueRect = currentTrackingOpaqueRect(m_opaqueRect, m_canvasLayerSt
ack); | 435 SkRect& opaqueRect = currentTrackingOpaqueRect(m_opaqueRect, m_canvasLayerSt
ack); |
432 opaqueRect.setEmpty(); | 436 opaqueRect.setEmpty(); |
433 } | 437 } |
434 | 438 |
435 } // namespace WebCore | 439 } // namespace WebCore |
OLD | NEW |