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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2557783002: Improve metrics for display list canvas fallback reason (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index 142aeed0e4480d3f0133ad2a143ae2408516d452..e1e6594446fd3a19eab30a2ec3c252379061f794 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -1099,7 +1099,8 @@ void HTMLCanvasElement::ensureUnacceleratedImageBuffer() {
PassRefPtr<Image> HTMLCanvasElement::copiedImage(
SourceDrawingBuffer sourceBuffer,
- AccelerationHint hint) const {
+ AccelerationHint hint,
+ SnapshotReason snapshotReason) const {
if (!isPaintable())
return nullptr;
if (!m_context)
@@ -1107,10 +1108,9 @@ PassRefPtr<Image> HTMLCanvasElement::copiedImage(
if (m_context->getContextType() ==
CanvasRenderingContext::ContextImageBitmap) {
- RefPtr<Image> image =
- m_context->getImage(hint, SnapshotReasonGetCopiedImage);
+ RefPtr<Image> image = m_context->getImage(hint, snapshotReason);
if (image)
- return m_context->getImage(hint, SnapshotReasonGetCopiedImage);
+ return m_context->getImage(hint, snapshotReason);
// Special case: transferFromImageBitmap is not yet called.
sk_sp<SkSurface> surface =
SkSurface::MakeRasterN32Premul(width(), height());
@@ -1122,8 +1122,7 @@ PassRefPtr<Image> HTMLCanvasElement::copiedImage(
if (m_context->is3d())
needToUpdate |= m_context->paintRenderingResultsToCanvas(sourceBuffer);
if (needToUpdate && buffer()) {
- m_copiedImage =
- buffer()->newImageSnapshot(hint, SnapshotReasonGetCopiedImage);
+ m_copiedImage = buffer()->newImageSnapshot(hint, snapshotReason);
updateExternallyAllocatedMemory();
}
return m_copiedImage;
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLCanvasElement.h ('k') | third_party/WebKit/Source/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698