| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 return; | 187 return; |
| 188 if (!verifyImageSize(image->size())) | 188 if (!verifyImageSize(image->size())) |
| 189 return; | 189 return; |
| 190 cc::CompositorFrame frame; | 190 cc::CompositorFrame frame; |
| 191 // TODO(crbug.com/652931): update the device_scale_factor | 191 // TODO(crbug.com/652931): update the device_scale_factor |
| 192 frame.metadata.device_scale_factor = 1.0f; | 192 frame.metadata.device_scale_factor = 1.0f; |
| 193 | 193 |
| 194 const gfx::Rect bounds(m_width, m_height); | 194 const gfx::Rect bounds(m_width, m_height); |
| 195 const int renderPassId = 1; | 195 const int renderPassId = 1; |
| 196 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); | 196 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); |
| 197 pass->SetAll(renderPassId, bounds, bounds, gfx::Transform(), false); | 197 pass->SetNew(renderPassId, bounds, bounds, gfx::Transform()); |
| 198 pass->has_transparent_background = false; |
| 198 | 199 |
| 199 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 200 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
| 200 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, false, 1.f, | 201 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, false, 1.f, |
| 201 SkBlendMode::kSrcOver, 0); | 202 SkBlendMode::kSrcOver, 0); |
| 202 | 203 |
| 203 cc::TransferableResource resource; | 204 cc::TransferableResource resource; |
| 204 resource.id = m_nextResourceId; | 205 resource.id = m_nextResourceId; |
| 205 resource.format = cc::ResourceFormat::RGBA_8888; | 206 resource.format = cc::ResourceFormat::RGBA_8888; |
| 206 // TODO(crbug.com/645590): filter should respect the image-rendering CSS | 207 // TODO(crbug.com/645590): filter should respect the image-rendering CSS |
| 207 // property of associated canvas element. | 208 // property of associated canvas element. |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 return true; | 410 return true; |
| 410 return false; | 411 return false; |
| 411 } | 412 } |
| 412 | 413 |
| 413 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { | 414 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { |
| 414 m_width = width; | 415 m_width = width; |
| 415 m_height = height; | 416 m_height = height; |
| 416 } | 417 } |
| 417 | 418 |
| 418 } // namespace blink | 419 } // namespace blink |
| OLD | NEW |