Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/video_layer_impl.h" | 5 #include "cc/video_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "cc/io_surface_draw_quad.h" | 8 #include "cc/io_surface_draw_quad.h" |
| 9 #include "cc/layer_tree_impl.h" | 9 #include "cc/layer_tree_impl.h" |
| 10 #include "cc/math_util.h" | 10 #include "cc/math_util.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 217 gfx::SizeF texScale(texWidthScale, texHeightScale); | 217 gfx::SizeF texScale(texWidthScale, texHeightScale); |
| 218 scoped_ptr<YUVVideoDrawQuad> yuvVideoQuad = YUVVideoDrawQuad::Create(); | 218 scoped_ptr<YUVVideoDrawQuad> yuvVideoQuad = YUVVideoDrawQuad::Create(); |
| 219 yuvVideoQuad->SetNew(sharedQuadState, quadRect, opaqueRect, texScale, yP lane, uPlane, vPlane); | 219 yuvVideoQuad->SetNew(sharedQuadState, quadRect, opaqueRect, texScale, yP lane, uPlane, vPlane); |
| 220 quadSink.append(yuvVideoQuad.PassAs<DrawQuad>(), appendQuadsData); | 220 quadSink.append(yuvVideoQuad.PassAs<DrawQuad>(), appendQuadsData); |
| 221 break; | 221 break; |
| 222 } | 222 } |
| 223 case GL_RGBA: { | 223 case GL_RGBA: { |
| 224 // RGBA software decoder. | 224 // RGBA software decoder. |
| 225 const FramePlane& plane = m_framePlanes[media::VideoFrame::kRGBPlane]; | 225 const FramePlane& plane = m_framePlanes[media::VideoFrame::kRGBPlane]; |
| 226 bool premultipliedAlpha = true; | 226 bool premultipliedAlpha = true; |
| 227 gfx::RectF uvRect(0, 0, texWidthScale, texHeightScale); | 227 gfx::PointF uvtl(0, 0); |
|
danakj
2013/01/10 18:12:26
uv_top_left
please dont use cryptic abbreviations
Jerome
2013/01/10 19:21:55
Done.
| |
| 228 gfx::PointF uvbr(texWidthScale, texHeightScale); | |
|
danakj
2013/01/10 18:12:26
being a bit unfamiliar with this stuff, i wonder i
Jerome
2013/01/10 19:21:55
Usually UV coordinates are expressed on a per vert
| |
| 228 const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; | 229 const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
| 229 bool flipped = false; | 230 bool flipped = false; |
| 230 scoped_ptr<TextureDrawQuad> textureQuad = TextureDrawQuad::Create(); | 231 scoped_ptr<TextureDrawQuad> textureQuad = TextureDrawQuad::Create(); |
| 231 textureQuad->SetNew(sharedQuadState, quadRect, opaqueRect, plane.resourc eId, premultipliedAlpha, uvRect, opacity, flipped); | 232 textureQuad->SetNew(sharedQuadState, quadRect, opaqueRect, plane.resourc eId, premultipliedAlpha, uvtl, uvbr, opacity, flipped); |
| 232 quadSink.append(textureQuad.PassAs<DrawQuad>(), appendQuadsData); | 233 quadSink.append(textureQuad.PassAs<DrawQuad>(), appendQuadsData); |
| 233 break; | 234 break; |
| 234 } | 235 } |
| 235 case GL_TEXTURE_2D: { | 236 case GL_TEXTURE_2D: { |
| 236 // NativeTexture hardware decoder. | 237 // NativeTexture hardware decoder. |
| 237 bool premultipliedAlpha = true; | 238 bool premultipliedAlpha = true; |
| 238 gfx::RectF uvRect(0, 0, texWidthScale, texHeightScale); | 239 gfx::PointF uvtl(0, 0); |
| 240 gfx::PointF uvbr(texWidthScale, texHeightScale); | |
| 239 const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; | 241 const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
| 240 bool flipped = false; | 242 bool flipped = false; |
| 241 scoped_ptr<TextureDrawQuad> textureQuad = TextureDrawQuad::Create(); | 243 scoped_ptr<TextureDrawQuad> textureQuad = TextureDrawQuad::Create(); |
| 242 textureQuad->SetNew(sharedQuadState, quadRect, opaqueRect, m_externalTex tureResource, premultipliedAlpha, uvRect, opacity, flipped); | 244 textureQuad->SetNew(sharedQuadState, quadRect, opaqueRect, m_externalTex tureResource, premultipliedAlpha, uvtl, uvbr, opacity, flipped); |
| 243 quadSink.append(textureQuad.PassAs<DrawQuad>(), appendQuadsData); | 245 quadSink.append(textureQuad.PassAs<DrawQuad>(), appendQuadsData); |
| 244 break; | 246 break; |
| 245 } | 247 } |
| 246 case GL_TEXTURE_RECTANGLE_ARB: { | 248 case GL_TEXTURE_RECTANGLE_ARB: { |
| 247 gfx::Size visibleSize(visibleRect.width(), visibleRect.height()); | 249 gfx::Size visibleSize(visibleRect.width(), visibleRect.height()); |
| 248 scoped_ptr<IOSurfaceDrawQuad> ioSurfaceQuad = IOSurfaceDrawQuad::Create( ); | 250 scoped_ptr<IOSurfaceDrawQuad> ioSurfaceQuad = IOSurfaceDrawQuad::Create( ); |
| 249 ioSurfaceQuad->SetNew(sharedQuadState, quadRect, opaqueRect, visibleSize , m_frame->texture_id(), IOSurfaceDrawQuad::UNFLIPPED); | 251 ioSurfaceQuad->SetNew(sharedQuadState, quadRect, opaqueRect, visibleSize , m_frame->texture_id(), IOSurfaceDrawQuad::UNFLIPPED); |
| 250 quadSink.append(ioSurfaceQuad.PassAs<DrawQuad>(), appendQuadsData); | 252 quadSink.append(ioSurfaceQuad.PassAs<DrawQuad>(), appendQuadsData); |
| 251 break; | 253 break; |
| 252 } | 254 } |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 418 { | 420 { |
| 419 layerTreeImpl()->SetNeedsRedraw(); | 421 layerTreeImpl()->SetNeedsRedraw(); |
| 420 } | 422 } |
| 421 | 423 |
| 422 const char* VideoLayerImpl::layerTypeAsString() const | 424 const char* VideoLayerImpl::layerTypeAsString() const |
| 423 { | 425 { |
| 424 return "VideoLayer"; | 426 return "VideoLayer"; |
| 425 } | 427 } |
| 426 | 428 |
| 427 } // namespace cc | 429 } // namespace cc |
| OLD | NEW |