| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 frame.metadata.device_scale_factor = 1.0f; | 188 frame.metadata.device_scale_factor = 1.0f; |
| 189 frame.delegated_frame_data.reset(new cc::DelegatedFrameData); | 189 frame.delegated_frame_data.reset(new cc::DelegatedFrameData); |
| 190 | 190 |
| 191 const gfx::Rect bounds(m_width, m_height); | 191 const gfx::Rect bounds(m_width, m_height); |
| 192 const cc::RenderPassId renderPassId(1, 1); | 192 const cc::RenderPassId renderPassId(1, 1); |
| 193 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); | 193 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); |
| 194 pass->SetAll(renderPassId, bounds, bounds, gfx::Transform(), false); | 194 pass->SetAll(renderPassId, bounds, bounds, gfx::Transform(), false); |
| 195 | 195 |
| 196 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 196 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
| 197 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, false, 1.f, | 197 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, false, 1.f, |
| 198 SkXfermode::kSrcOver_Mode, 0); | 198 SkBlendMode::kSrcOver, 0); |
| 199 | 199 |
| 200 cc::TransferableResource resource; | 200 cc::TransferableResource resource; |
| 201 resource.id = m_nextResourceId; | 201 resource.id = m_nextResourceId; |
| 202 resource.format = cc::ResourceFormat::RGBA_8888; | 202 resource.format = cc::ResourceFormat::RGBA_8888; |
| 203 // TODO(crbug.com/645590): filter should respect the image-rendering CSS | 203 // TODO(crbug.com/645590): filter should respect the image-rendering CSS |
| 204 // property of associated canvas element. | 204 // property of associated canvas element. |
| 205 resource.filter = GL_LINEAR; | 205 resource.filter = GL_LINEAR; |
| 206 resource.size = gfx::Size(m_width, m_height); | 206 resource.size = gfx::Size(m_width, m_height); |
| 207 // TODO(crbug.com/646022): making this overlay-able. | 207 // TODO(crbug.com/646022): making this overlay-able. |
| 208 resource.is_overlay_candidate = false; | 208 resource.is_overlay_candidate = false; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 } | 396 } |
| 397 | 397 |
| 398 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( | 398 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( |
| 399 const IntSize imageSize) { | 399 const IntSize imageSize) { |
| 400 if (imageSize.width() == m_width && imageSize.height() == m_height) | 400 if (imageSize.width() == m_width && imageSize.height() == m_height) |
| 401 return true; | 401 return true; |
| 402 return false; | 402 return false; |
| 403 } | 403 } |
| 404 | 404 |
| 405 } // namespace blink | 405 } // namespace blink |
| OLD | NEW |