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

Side by Side Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 1307143005: Make 2D canvas smarter about chosing whether or not to use GPU acceleration (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: migrated to chromium repo Created 5 years, 3 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) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 } 418 }
419 419
420 static PassRefPtr<Image> imageFromNode(const Node& node) 420 static PassRefPtr<Image> imageFromNode(const Node& node)
421 { 421 {
422 node.document().updateLayoutIgnorePendingStylesheets(); 422 node.document().updateLayoutIgnorePendingStylesheets();
423 LayoutObject* layoutObject = node.layoutObject(); 423 LayoutObject* layoutObject = node.layoutObject();
424 if (!layoutObject) 424 if (!layoutObject)
425 return nullptr; 425 return nullptr;
426 426
427 if (layoutObject->isCanvas()) 427 if (layoutObject->isCanvas())
428 return toHTMLCanvasElement(node).copiedImage(FrontBuffer); 428 return toHTMLCanvasElement(node).copiedImage(FrontBuffer, PreferNoAccele ration);
429 429
430 if (layoutObject->isImage()) { 430 if (layoutObject->isImage()) {
431 LayoutImage* layoutImage = toLayoutImage(layoutObject); 431 LayoutImage* layoutImage = toLayoutImage(layoutObject);
432 if (!layoutImage) 432 if (!layoutImage)
433 return nullptr; 433 return nullptr;
434 434
435 ImageResource* cachedImage = layoutImage->cachedImage(); 435 ImageResource* cachedImage = layoutImage->cachedImage();
436 if (!cachedImage || cachedImage->errorOccurred()) 436 if (!cachedImage || cachedImage->errorOccurred())
437 return nullptr; 437 return nullptr;
438 return cachedImage->imageForLayoutObject(layoutImage); 438 return cachedImage->imageForLayoutObject(layoutImage);
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 } 1301 }
1302 1302
1303 DEFINE_TRACE(Editor) 1303 DEFINE_TRACE(Editor)
1304 { 1304 {
1305 visitor->trace(m_frame); 1305 visitor->trace(m_frame);
1306 visitor->trace(m_lastEditCommand); 1306 visitor->trace(m_lastEditCommand);
1307 visitor->trace(m_mark); 1307 visitor->trace(m_mark);
1308 } 1308 }
1309 1309
1310 } // namespace blink 1310 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698