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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.cpp

Issue 2515623003: Stop OffscreenCanvas resize from changing placeholder attributes (Closed)
Patch Set: report correct intrinsic size Created 4 years, 1 month 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 | « third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/graphics/OffscreenCanvasPlaceholder.h" 5 #include "platform/graphics/OffscreenCanvasPlaceholder.h"
6 6
7 #include "platform/CrossThreadFunctional.h" 7 #include "platform/CrossThreadFunctional.h"
8 #include "platform/WebTaskRunner.h" 8 #include "platform/WebTaskRunner.h"
9 #include "platform/graphics/Image.h" 9 #include "platform/graphics/Image.h"
10 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h" 10 #include "platform/graphics/OffscreenCanvasFrameDispatcher.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 WeakPtr<OffscreenCanvasFrameDispatcher> dispatcher, 66 WeakPtr<OffscreenCanvasFrameDispatcher> dispatcher,
67 std::unique_ptr<WebTaskRunner> taskRunner, 67 std::unique_ptr<WebTaskRunner> taskRunner,
68 unsigned resourceId) { 68 unsigned resourceId) {
69 DCHECK(isPlaceholderRegistered()); 69 DCHECK(isPlaceholderRegistered());
70 DCHECK(newFrame); 70 DCHECK(newFrame);
71 releasePlaceholderFrame(); 71 releasePlaceholderFrame();
72 m_placeholderFrame = std::move(newFrame); 72 m_placeholderFrame = std::move(newFrame);
73 m_frameDispatcher = std::move(dispatcher); 73 m_frameDispatcher = std::move(dispatcher);
74 m_frameDispatcherTaskRunner = std::move(taskRunner); 74 m_frameDispatcherTaskRunner = std::move(taskRunner);
75 m_placeholderFrameResourceId = resourceId; 75 m_placeholderFrameResourceId = resourceId;
76 setSize(m_placeholderFrame->size());
77 } 76 }
78 77
79 void OffscreenCanvasPlaceholder::releasePlaceholderFrame() { 78 void OffscreenCanvasPlaceholder::releasePlaceholderFrame() {
80 DCHECK(isPlaceholderRegistered()); 79 DCHECK(isPlaceholderRegistered());
81 if (m_placeholderFrame) { 80 if (m_placeholderFrame) {
82 m_placeholderFrame->transfer(); 81 m_placeholderFrame->transfer();
83 m_frameDispatcherTaskRunner->postTask( 82 m_frameDispatcherTaskRunner->postTask(
84 BLINK_FROM_HERE, 83 BLINK_FROM_HERE,
85 crossThreadBind(releaseFrameToDispatcher, std::move(m_frameDispatcher), 84 crossThreadBind(releaseFrameToDispatcher, std::move(m_frameDispatcher),
86 std::move(m_placeholderFrame), 85 std::move(m_placeholderFrame),
87 m_placeholderFrameResourceId)); 86 m_placeholderFrameResourceId));
88 } 87 }
89 } 88 }
90 89
91 } // blink 90 } // blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698