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

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

Issue 2379653006: Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Created 4 years, 2 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/output/delegated_frame_data.h" 8 #include "cc/output/delegated_frame_data.h"
9 #include "cc/quads/render_pass.h" 9 #include "cc/quads/render_pass.h"
10 #include "cc/quads/shared_quad_state.h" 10 #include "cc/quads/shared_quad_state.h"
11 #include "cc/quads/solid_color_draw_quad.h" 11 #include "cc/quads/solid_color_draw_quad.h"
12 #include "cc/quads/texture_draw_quad.h" 12 #include "cc/quads/texture_draw_quad.h"
13 #include "cc/resources/returned_resource.h" 13 #include "cc/resources/returned_resource.h"
14 #include "public/platform/InterfaceProvider.h" 14 #include "public/platform/InterfaceProvider.h"
15 #include "public/platform/Platform.h" 15 #include "public/platform/Platform.h"
16 #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom -blink.h" 16 #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom -blink.h"
17 #include "third_party/khronos/GLES2/gl2.h" 17 #include "third_party/khronos/GLES2/gl2.h"
18 #include "third_party/skia/include/core/SkColor.h" 18 #include "third_party/skia/include/core/SkColor.h"
19 #include "third_party/skia/include/core/SkImage.h" 19 #include "third_party/skia/include/core/SkImage.h"
20 #include "third_party/skia/include/core/SkXfermode.h" 20 #include "third_party/skia/include/core/SkXfermode.h"
21 #include "ui/gfx/geometry/rect.h" 21 #include "ui/gfx/geometry/rect.h"
22 #include "ui/gfx/transform.h" 22 #include "ui/gfx/transform.h"
23 23
24 namespace blink { 24 namespace blink {
25 25
26 OffscreenCanvasFrameDispatcherImpl::OffscreenCanvasFrameDispatcherImpl(uint32_t clientId, uint32_t localId, uint64_t nonce, int width, int height) 26 OffscreenCanvasFrameDispatcherImpl::OffscreenCanvasFrameDispatcherImpl(uint32_t clientId, uint32_t localId, uint64_t nonceHigh, uint64_t nonceLow, int width, in t height)
27 : m_surfaceId(cc::SurfaceId(clientId, localId, nonce)) 27 : m_surfaceId(cc::SurfaceId(clientId, localId, base::UnguessableToken::Deser ialize(nonceHigh, nonceLow)))
28 , m_width(width) 28 , m_width(width)
29 , m_height(height) 29 , m_height(height)
30 , m_nextResourceId(1u) 30 , m_nextResourceId(1u)
31 , m_binding(this) 31 , m_binding(this)
32 { 32 {
33 DCHECK(!m_sink.is_bound()); 33 DCHECK(!m_sink.is_bound());
34 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; 34 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider;
35 Platform::current()->interfaceProvider()->getInterface(mojo::GetProxy(&provi der)); 35 Platform::current()->interfaceProvider()->getInterface(mojo::GetProxy(&provi der));
36 provider->CreateCompositorFrameSink(m_surfaceId, m_binding.CreateInterfacePt rAndBind(), mojo::GetProxy(&m_sink)); 36 provider->CreateCompositorFrameSink(m_surfaceId, m_binding.CreateInterfacePt rAndBind(), mojo::GetProxy(&m_sink));
37 } 37 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 109
110 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize(const sk_sp<SkImage>& i mage) 110 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize(const sk_sp<SkImage>& i mage)
111 { 111 {
112 if (image && image->width() == m_width && image->height() == m_height) 112 if (image && image->width() == m_width && image->height() == m_height)
113 return true; 113 return true;
114 return false; 114 return false;
115 } 115 }
116 116
117 } // namespace blink 117 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698