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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 m_paintStateIndex--; | 172 m_paintStateIndex--; |
173 m_paintState = m_paintStateStack[m_paintStateIndex].get(); | 173 m_paintState = m_paintStateStack[m_paintStateIndex].get(); |
174 } | 174 } |
175 | 175 |
176 CanvasSaveState savedState = m_canvasStateStack.last(); | 176 CanvasSaveState savedState = m_canvasStateStack.last(); |
177 m_canvasStateStack.removeLast(); | 177 m_canvasStateStack.removeLast(); |
178 m_canvasSaveFlags = savedState.m_flags; | 178 m_canvasSaveFlags = savedState.m_flags; |
179 m_canvas->restoreToCount(savedState.m_restoreCount); | 179 m_canvas->restoreToCount(savedState.m_restoreCount); |
180 } | 180 } |
181 | 181 |
182 void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint, SkCa nvas::SaveFlags saveFlags) | 182 void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint, |
183 SkCanvas::SaveFlags extraFlags) | |
183 { | 184 { |
184 if (paintingDisabled()) | 185 if (paintingDisabled()) |
185 return; | 186 return; |
186 | 187 |
187 realizeCanvasSave(SkCanvas::kMatrixClip_SaveFlag); | 188 realizeCanvasSave(SkCanvas::kMatrixClip_SaveFlag); |
188 | 189 |
189 m_canvas->saveLayer(bounds, paint, saveFlags); | 190 // Always save the clip & matrix. |
191 SkCanvas::SaveFlags flags = static_cast<SkCanvas::SaveFlags>( | |
192 SkCanvas::kMatrixClip_SaveFlag | extraFlags); | |
Stephen White
2014/03/26 17:45:52
Just an idea, but we could probably set these in t
f(malita)
2014/03/26 19:31:28
Done.
| |
193 m_canvas->saveLayer(bounds, paint, flags); | |
194 | |
190 if (bounds) | 195 if (bounds) |
191 m_canvas->clipRect(*bounds); | 196 m_canvas->clipRect(*bounds); |
192 if (m_trackOpaqueRegion) | 197 if (m_trackOpaqueRegion) |
193 m_opaqueRegion.pushCanvasLayer(paint); | 198 m_opaqueRegion.pushCanvasLayer(paint); |
194 } | 199 } |
195 | 200 |
196 void GraphicsContext::restoreLayer() | 201 void GraphicsContext::restoreLayer() |
197 { | 202 { |
198 if (paintingDisabled()) | 203 if (paintingDisabled()) |
199 return; | 204 return; |
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1885 | 1890 |
1886 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 1891 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
1887 { | 1892 { |
1888 if (m_trackTextRegion) { | 1893 if (m_trackTextRegion) { |
1889 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); | 1894 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); |
1890 m_textRegion.join(textRect); | 1895 m_textRegion.join(textRect); |
1891 } | 1896 } |
1892 } | 1897 } |
1893 | 1898 |
1894 } | 1899 } |
OLD | NEW |