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

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

Issue 2789753002: Convert offscreen canvas to use FrameSinkManagerHost. (Closed)
Patch Set: Rebase. 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
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/CrossThreadFunctional.h" 10 #include "platform/CrossThreadFunctional.h"
(...skipping 30 matching lines...) Expand all
41 change_size_for_next_commit_(false), 41 change_size_for_next_commit_(false),
42 needs_begin_frame_(false), 42 needs_begin_frame_(false),
43 next_resource_id_(1u), 43 next_resource_id_(1u),
44 binding_(this), 44 binding_(this),
45 placeholder_canvas_id_(canvas_id) { 45 placeholder_canvas_id_(canvas_id) {
46 if (frame_sink_id_.is_valid()) { 46 if (frame_sink_id_.is_valid()) {
47 // Only frameless canvas pass an invalid frame sink id; we don't create 47 // Only frameless canvas pass an invalid frame sink id; we don't create
48 // mojo channel for this special case. 48 // mojo channel for this special case.
49 current_local_surface_id_ = local_surface_id_allocator_.GenerateId(); 49 current_local_surface_id_ = local_surface_id_allocator_.GenerateId();
50 DCHECK(!sink_.is_bound()); 50 DCHECK(!sink_.is_bound());
51 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; 51 mojom::blink::OffscreenCanvasProviderPtr provider;
52 Platform::Current()->GetInterfaceProvider()->GetInterface( 52 Platform::Current()->GetInterfaceProvider()->GetInterface(
53 mojo::MakeRequest(&provider)); 53 mojo::MakeRequest(&provider));
54 provider->CreateCompositorFrameSink(frame_sink_id_, 54 provider->CreateCompositorFrameSink(frame_sink_id_,
55 binding_.CreateInterfacePtrAndBind(), 55 binding_.CreateInterfacePtrAndBind(),
56 mojo::MakeRequest(&sink_)); 56 mojo::MakeRequest(&sink_));
57 } 57 }
58 } 58 }
59 59
60 OffscreenCanvasFrameDispatcherImpl::~OffscreenCanvasFrameDispatcherImpl() { 60 OffscreenCanvasFrameDispatcherImpl::~OffscreenCanvasFrameDispatcherImpl() {
61 } 61 }
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 477
478 void OffscreenCanvasFrameDispatcherImpl::Reshape(int width, int height) { 478 void OffscreenCanvasFrameDispatcherImpl::Reshape(int width, int height) {
479 if (width_ != width || height_ != height) { 479 if (width_ != width || height_ != height) {
480 width_ = width; 480 width_ = width;
481 height_ = height; 481 height_ = height;
482 change_size_for_next_commit_ = true; 482 change_size_for_next_commit_ = true;
483 } 483 }
484 } 484 }
485 485
486 } // namespace blink 486 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698