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

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

Issue 977113003: Rename renderer() to layoutObject(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase to master Created 5 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 | 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 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 scrollPathIntoViewInternal(m_path); 1270 scrollPathIntoViewInternal(m_path);
1271 } 1271 }
1272 1272
1273 void CanvasRenderingContext2D::scrollPathIntoView(Path2D* path2d) 1273 void CanvasRenderingContext2D::scrollPathIntoView(Path2D* path2d)
1274 { 1274 {
1275 scrollPathIntoViewInternal(path2d->path()); 1275 scrollPathIntoViewInternal(path2d->path());
1276 } 1276 }
1277 1277
1278 void CanvasRenderingContext2D::scrollPathIntoViewInternal(const Path& path) 1278 void CanvasRenderingContext2D::scrollPathIntoViewInternal(const Path& path)
1279 { 1279 {
1280 LayoutObject* renderer = canvas()->renderer(); 1280 LayoutObject* renderer = canvas()->layoutObject();
1281 LayoutBox* layoutBox = canvas()->layoutBox(); 1281 LayoutBox* layoutBox = canvas()->layoutBox();
1282 if (!renderer || !layoutBox || !state().m_invertibleCTM || path.isEmpty()) 1282 if (!renderer || !layoutBox || !state().m_invertibleCTM || path.isEmpty())
1283 return; 1283 return;
1284 1284
1285 canvas()->document().updateLayoutIgnorePendingStylesheets(); 1285 canvas()->document().updateLayoutIgnorePendingStylesheets();
1286 1286
1287 // Apply transformation and get the bounding rect 1287 // Apply transformation and get the bounding rect
1288 Path transformedPath = path; 1288 Path transformedPath = path;
1289 transformedPath.transform(state().m_transform); 1289 transformedPath.transform(state().m_transform);
1290 FloatRect boundingRect = transformedPath.boundingRect(); 1290 FloatRect boundingRect = transformedPath.boundingRect();
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2410 AXObjectCache* axObjectCache = element->document().existingAXObjectCache(); 2410 AXObjectCache* axObjectCache = element->document().existingAXObjectCache();
2411 if (!axObjectCache) 2411 if (!axObjectCache)
2412 return; 2412 return;
2413 2413
2414 // Get the transformed path. 2414 // Get the transformed path.
2415 Path transformedPath = path; 2415 Path transformedPath = path;
2416 transformedPath.transform(state().m_transform); 2416 transformedPath.transform(state().m_transform);
2417 2417
2418 // Offset by the canvas rect, taking border and padding into account. 2418 // Offset by the canvas rect, taking border and padding into account.
2419 LayoutBoxModelObject* rbmo = canvas()->layoutBoxModelObject(); 2419 LayoutBoxModelObject* rbmo = canvas()->layoutBoxModelObject();
2420 IntRect canvasRect = canvas()->renderer()->absoluteBoundingBoxRect(); 2420 IntRect canvasRect = canvas()->layoutObject()->absoluteBoundingBoxRect();
2421 canvasRect.move(rbmo->borderLeft() + rbmo->paddingLeft(), rbmo->borderTop() + rbmo->paddingTop()); 2421 canvasRect.move(rbmo->borderLeft() + rbmo->paddingLeft(), rbmo->borderTop() + rbmo->paddingTop());
2422 LayoutRect elementRect = enclosingLayoutRect(transformedPath.boundingRect()) ; 2422 LayoutRect elementRect = enclosingLayoutRect(transformedPath.boundingRect()) ;
2423 elementRect.moveBy(canvasRect.location()); 2423 elementRect.moveBy(canvasRect.location());
2424 axObjectCache->setCanvasObjectBounds(element, elementRect); 2424 axObjectCache->setCanvasObjectBounds(element, elementRect);
2425 } 2425 }
2426 2426
2427 void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc eptionState& exceptionState) 2427 void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc eptionState& exceptionState)
2428 { 2428 {
2429 if (options.id().isEmpty() && !options.control()) { 2429 if (options.id().isEmpty() && !options.control()) {
2430 exceptionState.throwDOMException(NotSupportedError, "Both id and control are null."); 2430 exceptionState.throwDOMException(NotSupportedError, "Both id and control are null.");
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2553 if (imageType == NonOpaqueImage) 2553 if (imageType == NonOpaqueImage)
2554 return; 2554 return;
2555 if (alpha < 0xFF) 2555 if (alpha < 0xFF)
2556 return; 2556 return;
2557 } 2557 }
2558 2558
2559 canvas()->buffer()->willOverwriteCanvas(); 2559 canvas()->buffer()->willOverwriteCanvas();
2560 } 2560 }
2561 2561
2562 } // namespace blink 2562 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698