Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
| 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
| 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 10 * | 10 * |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 #include "core/layout/LayoutBox.h" | 52 #include "core/layout/LayoutBox.h" |
| 53 #include "core/layout/LayoutTheme.h" | 53 #include "core/layout/LayoutTheme.h" |
| 54 #include "modules/canvas2d/CanvasGradient.h" | 54 #include "modules/canvas2d/CanvasGradient.h" |
| 55 #include "modules/canvas2d/CanvasPattern.h" | 55 #include "modules/canvas2d/CanvasPattern.h" |
| 56 #include "modules/canvas2d/CanvasRenderingContext2DState.h" | 56 #include "modules/canvas2d/CanvasRenderingContext2DState.h" |
| 57 #include "modules/canvas2d/CanvasStyle.h" | 57 #include "modules/canvas2d/CanvasStyle.h" |
| 58 #include "modules/canvas2d/HitRegion.h" | 58 #include "modules/canvas2d/HitRegion.h" |
| 59 #include "modules/canvas2d/Path2D.h" | 59 #include "modules/canvas2d/Path2D.h" |
| 60 #include "platform/fonts/FontCache.h" | 60 #include "platform/fonts/FontCache.h" |
| 61 #include "platform/geometry/FloatQuad.h" | 61 #include "platform/geometry/FloatQuad.h" |
| 62 #include "platform/graphics/CanvasMetrics.h" | |
| 62 #include "platform/graphics/DrawLooperBuilder.h" | 63 #include "platform/graphics/DrawLooperBuilder.h" |
| 63 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" | 64 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" |
| 64 #include "platform/graphics/ImageBuffer.h" | 65 #include "platform/graphics/ImageBuffer.h" |
| 65 #include "platform/graphics/StrokeData.h" | 66 #include "platform/graphics/StrokeData.h" |
| 66 #include "platform/graphics/skia/SkiaUtils.h" | 67 #include "platform/graphics/skia/SkiaUtils.h" |
| 67 #include "platform/text/BidiTextRun.h" | 68 #include "platform/text/BidiTextRun.h" |
| 68 #include "public/platform/Platform.h" | 69 #include "public/platform/Platform.h" |
| 69 #include "third_party/skia/include/core/SkCanvas.h" | 70 #include "third_party/skia/include/core/SkCanvas.h" |
| 70 #include "third_party/skia/include/core/SkImageFilter.h" | 71 #include "third_party/skia/include/core/SkImageFilter.h" |
| 71 #include "wtf/ArrayBufferContents.h" | 72 #include "wtf/ArrayBufferContents.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 , m_tryRestoreContextAttemptCount(0) | 127 , m_tryRestoreContextAttemptCount(0) |
| 127 , m_dispatchContextLostEventTimer(this, &CanvasRenderingContext2D::dispatchC ontextLostEvent) | 128 , m_dispatchContextLostEventTimer(this, &CanvasRenderingContext2D::dispatchC ontextLostEvent) |
| 128 , m_dispatchContextRestoredEventTimer(this, &CanvasRenderingContext2D::dispa tchContextRestoredEvent) | 129 , m_dispatchContextRestoredEventTimer(this, &CanvasRenderingContext2D::dispa tchContextRestoredEvent) |
| 129 , m_tryRestoreContextEventTimer(this, &CanvasRenderingContext2D::tryRestoreC ontextEvent) | 130 , m_tryRestoreContextEventTimer(this, &CanvasRenderingContext2D::tryRestoreC ontextEvent) |
| 130 , m_pruneLocalFontCacheScheduled(false) | 131 , m_pruneLocalFontCacheScheduled(false) |
| 131 { | 132 { |
| 132 if (document.settings() && document.settings()->antialiasedClips2dCanvasEnab led()) | 133 if (document.settings() && document.settings()->antialiasedClips2dCanvasEnab led()) |
| 133 m_clipAntialiasing = AntiAliased; | 134 m_clipAntialiasing = AntiAliased; |
| 134 m_stateStack.append(CanvasRenderingContext2DState::create()); | 135 m_stateStack.append(CanvasRenderingContext2DState::create()); |
| 135 setShouldAntialias(true); | 136 setShouldAntialias(true); |
| 137 CanvasMetrics::countCanvasContextStat(CanvasMetrics::CanvasContextCreated); | |
|
Justin Novosad
2015/11/20 03:30:44
This should be more specific: I'd like 2DContextCr
zmin
2015/11/20 17:08:33
Removed.
| |
| 136 } | 138 } |
| 137 | 139 |
| 138 void CanvasRenderingContext2D::unwindStateStack() | 140 void CanvasRenderingContext2D::unwindStateStack() |
| 139 { | 141 { |
| 140 if (size_t stackSize = m_stateStack.size()) { | 142 if (size_t stackSize = m_stateStack.size()) { |
| 141 if (SkCanvas* skCanvas = canvas()->existingDrawingCanvas()) { | 143 if (SkCanvas* skCanvas = canvas()->existingDrawingCanvas()) { |
| 142 while (--stackSize) | 144 while (--stackSize) |
| 143 skCanvas->restore(); | 145 skCanvas->restore(); |
| 144 } | 146 } |
| 145 } | 147 } |
| (...skipping 2187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2333 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) | 2335 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) |
| 2334 return; | 2336 return; |
| 2335 if (alpha < 0xFF) | 2337 if (alpha < 0xFF) |
| 2336 return; | 2338 return; |
| 2337 } | 2339 } |
| 2338 | 2340 |
| 2339 canvas()->buffer()->willOverwriteCanvas(); | 2341 canvas()->buffer()->willOverwriteCanvas(); |
| 2340 } | 2342 } |
| 2341 | 2343 |
| 2342 } // namespace blink | 2344 } // namespace blink |
| OLD | NEW |