Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(987)

Side by Side Diff: Source/WebCore/platform/graphics/skia/OpaqueRegionSkia.cpp

Issue 10913094: Merge 126901 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698