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

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 177473003: Use SkLayerDrawLooper::Builder to construct SkLayerDrawLooper. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 9 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 | Source/core/rendering/EllipsisBox.cpp » ('j') | 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) 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "core/html/TextMetrics.h" 53 #include "core/html/TextMetrics.h"
54 #include "core/html/canvas/CanvasGradient.h" 54 #include "core/html/canvas/CanvasGradient.h"
55 #include "core/html/canvas/CanvasPattern.h" 55 #include "core/html/canvas/CanvasPattern.h"
56 #include "core/html/canvas/CanvasStyle.h" 56 #include "core/html/canvas/CanvasStyle.h"
57 #include "core/html/canvas/Path2D.h" 57 #include "core/html/canvas/Path2D.h"
58 #include "core/rendering/RenderImage.h" 58 #include "core/rendering/RenderImage.h"
59 #include "core/rendering/RenderLayer.h" 59 #include "core/rendering/RenderLayer.h"
60 #include "core/rendering/RenderTheme.h" 60 #include "core/rendering/RenderTheme.h"
61 #include "platform/fonts/FontCache.h" 61 #include "platform/fonts/FontCache.h"
62 #include "platform/geometry/FloatQuad.h" 62 #include "platform/geometry/FloatQuad.h"
63 #include "platform/graphics/DrawLooperBuilder.h"
63 #include "platform/graphics/GraphicsContextStateSaver.h" 64 #include "platform/graphics/GraphicsContextStateSaver.h"
64 #include "platform/graphics/DrawLooper.h"
65 #include "platform/text/TextRun.h" 65 #include "platform/text/TextRun.h"
66 #include "wtf/CheckedArithmetic.h" 66 #include "wtf/CheckedArithmetic.h"
67 #include "wtf/MathExtras.h" 67 #include "wtf/MathExtras.h"
68 #include "wtf/OwnPtr.h" 68 #include "wtf/OwnPtr.h"
69 #include "wtf/Uint8ClampedArray.h" 69 #include "wtf/Uint8ClampedArray.h"
70 #include "wtf/text/StringBuilder.h" 70 #include "wtf/text/StringBuilder.h"
71 71
72 using namespace std; 72 using namespace std;
73 73
74 namespace WebCore { 74 namespace WebCore {
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 } 1283 }
1284 1284
1285 void CanvasRenderingContext2D::applyShadow() 1285 void CanvasRenderingContext2D::applyShadow()
1286 { 1286 {
1287 GraphicsContext* c = drawingContext(); 1287 GraphicsContext* c = drawingContext();
1288 if (!c) 1288 if (!c)
1289 return; 1289 return;
1290 1290
1291 if (shouldDrawShadows()) { 1291 if (shouldDrawShadows()) {
1292 c->setShadow(state().m_shadowOffset, state().m_shadowBlur, state().m_sha dowColor, 1292 c->setShadow(state().m_shadowOffset, state().m_shadowBlur, state().m_sha dowColor,
1293 DrawLooper::ShadowIgnoresTransforms); 1293 DrawLooperBuilder::ShadowIgnoresTransforms);
1294 } else { 1294 } else {
1295 c->clearShadow(); 1295 c->clearShadow();
1296 } 1296 }
1297 } 1297 }
1298 1298
1299 bool CanvasRenderingContext2D::shouldDrawShadows() const 1299 bool CanvasRenderingContext2D::shouldDrawShadows() const
1300 { 1300 {
1301 return alphaChannel(state().m_shadowColor) && (state().m_shadowBlur || !stat e().m_shadowOffset.isZero()); 1301 return alphaChannel(state().m_shadowColor) && (state().m_shadowBlur || !stat e().m_shadowOffset.isZero());
1302 } 1302 }
1303 1303
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 const int focusRingWidth = 5; 2300 const int focusRingWidth = 5;
2301 const int focusRingOutline = 0; 2301 const int focusRingOutline = 0;
2302 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); 2302 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor);
2303 2303
2304 c->restore(); 2304 c->restore();
2305 2305
2306 didDraw(dirtyRect); 2306 didDraw(dirtyRect);
2307 } 2307 }
2308 2308
2309 } // namespace WebCore 2309 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/EllipsisBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698