OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId); | 81 context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId); |
82 IntSize size = m_drawingBuffer->size(); | 82 IntSize size = m_drawingBuffer->size(); |
83 context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, Graphi
csContext3D::RGBA, size.width(), size.height(), 0, GraphicsContext3D::RGBA, Grap
hicsContext3D::UNSIGNED_BYTE); | 83 context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, Graphi
csContext3D::RGBA, size.width(), size.height(), 0, GraphicsContext3D::RGBA, Grap
hicsContext3D::UNSIGNED_BYTE); |
84 // Set the min-mag filters to linear and wrap modes to GraphicsContext3D
::CLAMP_TO_EDGE | 84 // Set the min-mag filters to linear and wrap modes to GraphicsContext3D
::CLAMP_TO_EDGE |
85 // to get around NPOT texture limitations of GLES. | 85 // to get around NPOT texture limitations of GLES. |
86 context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D:
:TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR); | 86 context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D:
:TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR); |
87 context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D:
:TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR); | 87 context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D:
:TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR); |
88 context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D:
:TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE); | 88 context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D:
:TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE); |
89 context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D:
:TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE); | 89 context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D:
:TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE); |
90 m_textureChanged = false; | 90 m_textureChanged = false; |
91 // FIXME: The finish() here is required because we have to make sure tha
t the texture created in this | 91 // The flush() here is required because we have to make sure that the te
xture created in this |
92 // context (the compositor context) is actually created by the service s
ide before the child context | 92 // context (the compositor context) is actually created by the service s
ide before the child context |
93 // attempts to use it (in publishToPlatformLayer). finish() is currentl
y the only call with strong | 93 // attempts to use it (in publishToPlatformLayer). |
94 // enough semantics to promise this, but is actually much stronger. Ide
ally we'd do something like | 94 context->flush(); |
95 // inserting a fence here and waiting for it before trying to publish. | |
96 context->finish(); | |
97 } | 95 } |
98 // Update the contents of the texture used by the compositor. | 96 // Update the contents of the texture used by the compositor. |
99 if (m_contentsDirty) { | 97 if (m_contentsDirty) { |
100 m_drawingBuffer->publishToPlatformLayer(); | 98 m_drawingBuffer->publishToPlatformLayer(); |
101 m_contentsDirty = false; | 99 m_contentsDirty = false; |
102 } | 100 } |
103 } | 101 } |
104 | 102 |
105 void Canvas2DLayerChromium::setTextureChanged() | 103 void Canvas2DLayerChromium::setTextureChanged() |
106 { | 104 { |
(...skipping 28 matching lines...) Expand all Loading... |
135 if (newLayerRenderer) | 133 if (newLayerRenderer) |
136 newLayerRenderer->addChildContext(m_drawingBuffer->graphicsConte
xt3D().get()); | 134 newLayerRenderer->addChildContext(m_drawingBuffer->graphicsConte
xt3D().get()); |
137 } | 135 } |
138 | 136 |
139 LayerChromium::setLayerRenderer(newLayerRenderer); | 137 LayerChromium::setLayerRenderer(newLayerRenderer); |
140 } | 138 } |
141 } | 139 } |
142 | 140 |
143 } | 141 } |
144 #endif // USE(ACCELERATED_COMPOSITING) | 142 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |