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

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

Issue 2455983005: Refactor AcceleratedStaticBitmapImage (Closed)
Patch Set: 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
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/OffscreenCanvasFrameDispatcherImpl.h" 5 #include "platform/graphics/OffscreenCanvasFrameDispatcherImpl.h"
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "cc/quads/texture_draw_quad.h" 8 #include "cc/quads/texture_draw_quad.h"
9 #include "gpu/command_buffer/client/gles2_interface.h" 9 #include "gpu/command_buffer/client/gles2_interface.h"
10 #include "platform/Histogram.h" 10 #include "platform/Histogram.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 m_sink->SubmitCompositorFrame(std::move(frame)); 314 m_sink->SubmitCompositorFrame(std::move(frame));
315 } 315 }
316 316
317 void OffscreenCanvasFrameDispatcherImpl::DidReceiveCompositorFrameAck() { 317 void OffscreenCanvasFrameDispatcherImpl::DidReceiveCompositorFrameAck() {
318 // TODO(fsamuel): Implement this. 318 // TODO(fsamuel): Implement this.
319 } 319 }
320 320
321 void OffscreenCanvasFrameDispatcherImpl::ReclaimResources( 321 void OffscreenCanvasFrameDispatcherImpl::ReclaimResources(
322 const cc::ReturnedResourceArray& resources) { 322 const cc::ReturnedResourceArray& resources) {
323 for (const auto& resource : resources) { 323 for (const auto& resource : resources) {
324 RefPtr<StaticBitmapImage> image = m_cachedImages.get(resource.id);
325 if (image)
326 image->deleteTexture(resource.sync_token.GetConstData());
xidachen 2016/10/27 20:20:45 junov@: With this change, the commit() will crash
Justin Novosad 2016/10/28 18:08:00 We should not be deleting any textures here. We sh
xidachen 2016/10/28 21:14:15 In the new PS, I move the DeleteTexture to the des
324 m_cachedImages.remove(resource.id); 327 m_cachedImages.remove(resource.id);
325 m_sharedBitmaps.remove(resource.id); 328 m_sharedBitmaps.remove(resource.id);
326 m_cachedTextureIds.remove(resource.id); 329 m_cachedTextureIds.remove(resource.id);
327 } 330 }
328 } 331 }
329 332
330 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( 333 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize(
331 const sk_sp<SkImage>& image) { 334 const sk_sp<SkImage>& image) {
332 if (image && image->width() == m_width && image->height() == m_height) 335 if (image && image->width() == m_width && image->height() == m_height)
333 return true; 336 return true;
334 return false; 337 return false;
335 } 338 }
336 339
337 } // namespace blink 340 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698