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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2799033002: Do compositing update when switching from software to accelerated canvas (Closed)
Patch Set: Created 3 years, 8 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 | third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h » ('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, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 if (ExpensiveCanvasHeuristicParameters::EnableAccelerationToAvoidReadbacks && 1228 if (ExpensiveCanvasHeuristicParameters::EnableAccelerationToAvoidReadbacks &&
1229 source->isAccelerated() && !buffer()->isAccelerated() && 1229 source->isAccelerated() && !buffer()->isAccelerated() &&
1230 shouldAccelerate(IgnoreResourceLimitCriteria)) { 1230 shouldAccelerate(IgnoreResourceLimitCriteria)) {
1231 OpacityMode opacityMode = 1231 OpacityMode opacityMode =
1232 m_context->creationAttributes().alpha() ? NonOpaque : Opaque; 1232 m_context->creationAttributes().alpha() ? NonOpaque : Opaque;
1233 int msaaSampleCount = 0; 1233 int msaaSampleCount = 0;
1234 std::unique_ptr<ImageBufferSurface> surface = 1234 std::unique_ptr<ImageBufferSurface> surface =
1235 createAcceleratedImageBufferSurface(opacityMode, &msaaSampleCount); 1235 createAcceleratedImageBufferSurface(opacityMode, &msaaSampleCount);
1236 if (surface) { 1236 if (surface) {
1237 buffer()->setSurface(std::move(surface)); 1237 buffer()->setSurface(std::move(surface));
1238 setNeedsCompositingUpdate();
1238 } 1239 }
1239 } 1240 }
1240 } 1241 }
1241 1242
1242 PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas( 1243 PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas(
1243 SourceImageStatus* status, 1244 SourceImageStatus* status,
1244 AccelerationHint hint, 1245 AccelerationHint hint,
1245 SnapshotReason reason, 1246 SnapshotReason reason,
1246 const FloatSize&) const { 1247 const FloatSize&) const {
1247 if (!width() || !height()) { 1248 if (!width() || !height()) {
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 // Creates a placeholder layer first before Surface is created. 1463 // Creates a placeholder layer first before Surface is created.
1463 m_surfaceLayerBridge->createSolidColorLayer(); 1464 m_surfaceLayerBridge->createSolidColorLayer();
1464 } 1465 }
1465 } 1466 }
1466 1467
1467 void HTMLCanvasElement::OnWebLayerReplaced() { 1468 void HTMLCanvasElement::OnWebLayerReplaced() {
1468 setNeedsCompositingUpdate(); 1469 setNeedsCompositingUpdate();
1469 } 1470 }
1470 1471
1471 } // namespace blink 1472 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698