OLD | NEW |
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 return; | 183 return; |
184 if (!verifyImageSize(image->size())) | 184 if (!verifyImageSize(image->size())) |
185 return; | 185 return; |
186 cc::CompositorFrame frame; | 186 cc::CompositorFrame frame; |
187 // TODO(crbug.com/652931): update the device_scale_factor | 187 // TODO(crbug.com/652931): update the device_scale_factor |
188 frame.metadata.device_scale_factor = 1.0f; | 188 frame.metadata.device_scale_factor = 1.0f; |
189 | 189 |
190 const gfx::Rect bounds(m_width, m_height); | 190 const gfx::Rect bounds(m_width, m_height); |
191 const cc::RenderPassId renderPassId(1, 1); | 191 const cc::RenderPassId renderPassId(1, 1); |
192 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); | 192 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); |
193 pass->SetAll(renderPassId, bounds, bounds, gfx::Transform(), false); | 193 pass->SetAll(renderPassId, bounds, bounds, gfx::Transform(), |
| 194 cc::FilterOperations(), cc::FilterOperations(), false); |
194 | 195 |
195 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 196 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
196 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, false, 1.f, | 197 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, false, 1.f, |
197 SkBlendMode::kSrcOver, 0); | 198 SkBlendMode::kSrcOver, 0); |
198 | 199 |
199 cc::TransferableResource resource; | 200 cc::TransferableResource resource; |
200 resource.id = m_nextResourceId; | 201 resource.id = m_nextResourceId; |
201 resource.format = cc::ResourceFormat::RGBA_8888; | 202 resource.format = cc::ResourceFormat::RGBA_8888; |
202 // TODO(crbug.com/645590): filter should respect the image-rendering CSS | 203 // TODO(crbug.com/645590): filter should respect the image-rendering CSS |
203 // property of associated canvas element. | 204 // property of associated canvas element. |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 return true; | 401 return true; |
401 return false; | 402 return false; |
402 } | 403 } |
403 | 404 |
404 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { | 405 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { |
405 m_width = width; | 406 m_width = width; |
406 m_height = height; | 407 m_height = height; |
407 } | 408 } |
408 | 409 |
409 } // namespace blink | 410 } // namespace blink |
OLD | NEW |