OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/texture_copier.h" | 7 #include "cc/texture_copier.h" |
8 | 8 |
9 #include "CCRendererGL.h" // For the GLC() macro. | 9 #include "CCRendererGL.h" // For the GLC() macro. |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include <public/WebGraphicsContext3D.h> | 11 #include <public/WebGraphicsContext3D.h> |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 AcceleratedTextureCopier::AcceleratedTextureCopier(WebKit::WebGraphicsContext3D*
context, bool usingBindUniforms) | 15 AcceleratedTextureCopier::AcceleratedTextureCopier(WebKit::WebGraphicsContext3D*
context, bool usingBindUniforms) |
16 : m_context(context) | 16 : m_context(context) |
17 , m_usingBindUniforms(usingBindUniforms) | 17 , m_usingBindUniforms(usingBindUniforms) |
18 { | 18 { |
19 ASSERT(m_context); | 19 DCHECK(m_context); |
20 GLC(m_context, m_fbo = m_context->createFramebuffer()); | 20 GLC(m_context, m_fbo = m_context->createFramebuffer()); |
21 GLC(m_context, m_positionBuffer = m_context->createBuffer()); | 21 GLC(m_context, m_positionBuffer = m_context->createBuffer()); |
22 | 22 |
23 static const float kPositions[4][4] = { | 23 static const float kPositions[4][4] = { |
24 {-1, -1, 0, 1}, | 24 {-1, -1, 0, 1}, |
25 { 1, -1, 0, 1}, | 25 { 1, -1, 0, 1}, |
26 { 1, 1, 0, 1}, | 26 { 1, 1, 0, 1}, |
27 {-1, 1, 0, 1} | 27 {-1, 1, 0, 1} |
28 }; | 28 }; |
29 | 29 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0)
); | 88 GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0)
); |
89 GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0)); | 89 GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0)); |
90 } | 90 } |
91 | 91 |
92 void AcceleratedTextureCopier::flush() | 92 void AcceleratedTextureCopier::flush() |
93 { | 93 { |
94 GLC(m_context, m_context->flush()); | 94 GLC(m_context, m_context->flush()); |
95 } | 95 } |
96 | 96 |
97 } | 97 } |
OLD | NEW |