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

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

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 } 1231 }
1232 1232
1233 void CanvasRenderingContext2D::scrollPathIntoView(Path2D* path2d) 1233 void CanvasRenderingContext2D::scrollPathIntoView(Path2D* path2d)
1234 { 1234 {
1235 scrollPathIntoViewInternal(path2d->path()); 1235 scrollPathIntoViewInternal(path2d->path());
1236 } 1236 }
1237 1237
1238 void CanvasRenderingContext2D::scrollPathIntoViewInternal(const Path& path) 1238 void CanvasRenderingContext2D::scrollPathIntoViewInternal(const Path& path)
1239 { 1239 {
1240 LayoutObject* renderer = canvas()->renderer(); 1240 LayoutObject* renderer = canvas()->renderer();
1241 RenderBox* renderBox = canvas()->renderBox(); 1241 LayoutBox* layoutBox = canvas()->layoutBox();
1242 if (!renderer || !renderBox || !state().m_invertibleCTM || path.isEmpty()) 1242 if (!renderer || !layoutBox || !state().m_invertibleCTM || path.isEmpty())
1243 return; 1243 return;
1244 1244
1245 canvas()->document().updateLayoutIgnorePendingStylesheets(); 1245 canvas()->document().updateLayoutIgnorePendingStylesheets();
1246 1246
1247 // Apply transformation and get the bounding rect 1247 // Apply transformation and get the bounding rect
1248 Path transformedPath = path; 1248 Path transformedPath = path;
1249 transformedPath.transform(state().m_transform); 1249 transformedPath.transform(state().m_transform);
1250 FloatRect boundingRect = transformedPath.boundingRect(); 1250 FloatRect boundingRect = transformedPath.boundingRect();
1251 1251
1252 // Offset by the canvas rect 1252 // Offset by the canvas rect
1253 LayoutRect pathRect(boundingRect); 1253 LayoutRect pathRect(boundingRect);
1254 IntRect canvasRect = renderBox->absoluteContentBox(); 1254 IntRect canvasRect = layoutBox->absoluteContentBox();
1255 pathRect.move(canvasRect.x(), canvasRect.y()); 1255 pathRect.move(canvasRect.x(), canvasRect.y());
1256 1256
1257 renderer->scrollRectToVisible( 1257 renderer->scrollRectToVisible(
1258 pathRect, ScrollAlignment::alignCenterAlways, ScrollAlignment::alignTopA lways); 1258 pathRect, ScrollAlignment::alignCenterAlways, ScrollAlignment::alignTopA lways);
1259 1259
1260 // TODO: should implement "inform the user" that the caret and/or 1260 // TODO: should implement "inform the user" that the caret and/or
1261 // selection the specified rectangle of the canvas. See http://crbug.com/357 987 1261 // selection the specified rectangle of the canvas. See http://crbug.com/357 987
1262 } 1262 }
1263 1263
1264 void CanvasRenderingContext2D::clearRect(float x, float y, float width, float he ight) 1264 void CanvasRenderingContext2D::clearRect(float x, float y, float width, float he ight)
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
2478 if (imageType == NonOpaqueImage) 2478 if (imageType == NonOpaqueImage)
2479 return; 2479 return;
2480 if (alpha < 0xFF) 2480 if (alpha < 0xFF)
2481 return; 2481 return;
2482 } 2482 }
2483 2483
2484 canvas()->buffer()->willOverwriteCanvas(); 2484 canvas()->buffer()->willOverwriteCanvas();
2485 } 2485 }
2486 2486
2487 } // namespace blink 2487 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLSelectElement.cpp ('k') | Source/core/html/canvas/WebGLRenderingContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698