| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * Copyright (C) 2010 Mozilla Corporation. All rights reserved. | 4 * Copyright (C) 2010 Mozilla Corporation. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 } | 62 } |
| 63 | 63 |
| 64 namespace WebCore { | 64 namespace WebCore { |
| 65 | 65 |
| 66 namespace { | 66 namespace { |
| 67 | 67 |
| 68 void getDrawingParameters(DrawingBuffer* drawingBuffer, WebKit::WebGraphicsConte
xt3D* graphicsContext3D, | 68 void getDrawingParameters(DrawingBuffer* drawingBuffer, WebKit::WebGraphicsConte
xt3D* graphicsContext3D, |
| 69 Platform3DObject* frameBufferId, int* width, int* heig
ht) | 69 Platform3DObject* frameBufferId, int* width, int* heig
ht) |
| 70 { | 70 { |
| 71 if (drawingBuffer) { | 71 ASSERT(drawingBuffer); |
| 72 *frameBufferId = drawingBuffer->framebuffer(); | 72 *frameBufferId = drawingBuffer->framebuffer(); |
| 73 *width = drawingBuffer->size().width(); | 73 *width = drawingBuffer->size().width(); |
| 74 *height = drawingBuffer->size().height(); | 74 *height = drawingBuffer->size().height(); |
| 75 } else { | |
| 76 *frameBufferId = 0; | |
| 77 *width = graphicsContext3D->width(); | |
| 78 *height = graphicsContext3D->height(); | |
| 79 } | |
| 80 } | 75 } |
| 81 | 76 |
| 82 } // anonymous namespace | 77 } // anonymous namespace |
| 83 | 78 |
| 84 GraphicsContext3D::GraphicsContext3D(PassOwnPtr<WebKit::WebGraphicsContext3D> we
bContext, bool preserveDrawingBuffer) | 79 GraphicsContext3D::GraphicsContext3D(PassOwnPtr<WebKit::WebGraphicsContext3D> we
bContext, bool preserveDrawingBuffer) |
| 85 : m_impl(webContext.get()) | 80 : m_impl(webContext.get()) |
| 86 , m_ownedWebContext(webContext) | 81 , m_ownedWebContext(webContext) |
| 87 , m_initializedAvailableExtensions(false) | 82 , m_initializedAvailableExtensions(false) |
| 88 , m_layerComposited(false) | 83 , m_layerComposited(false) |
| 89 , m_preserveDrawingBuffer(preserveDrawingBuffer) | 84 , m_preserveDrawingBuffer(preserveDrawingBuffer) |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 DELEGATE_TO_WEBCONTEXT_3(vertexAttrib2f, GC3Duint, GC3Dfloat, GC3Dfloat) | 560 DELEGATE_TO_WEBCONTEXT_3(vertexAttrib2f, GC3Duint, GC3Dfloat, GC3Dfloat) |
| 566 DELEGATE_TO_WEBCONTEXT_2(vertexAttrib2fv, GC3Duint, GC3Dfloat*) | 561 DELEGATE_TO_WEBCONTEXT_2(vertexAttrib2fv, GC3Duint, GC3Dfloat*) |
| 567 DELEGATE_TO_WEBCONTEXT_4(vertexAttrib3f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dflo
at) | 562 DELEGATE_TO_WEBCONTEXT_4(vertexAttrib3f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dflo
at) |
| 568 DELEGATE_TO_WEBCONTEXT_2(vertexAttrib3fv, GC3Duint, GC3Dfloat*) | 563 DELEGATE_TO_WEBCONTEXT_2(vertexAttrib3fv, GC3Duint, GC3Dfloat*) |
| 569 DELEGATE_TO_WEBCONTEXT_5(vertexAttrib4f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dflo
at, GC3Dfloat) | 564 DELEGATE_TO_WEBCONTEXT_5(vertexAttrib4f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dflo
at, GC3Dfloat) |
| 570 DELEGATE_TO_WEBCONTEXT_2(vertexAttrib4fv, GC3Duint, GC3Dfloat*) | 565 DELEGATE_TO_WEBCONTEXT_2(vertexAttrib4fv, GC3Duint, GC3Dfloat*) |
| 571 DELEGATE_TO_WEBCONTEXT_6(vertexAttribPointer, GC3Duint, GC3Dint, GC3Denum, GC3Db
oolean, GC3Dsizei, GC3Dintptr) | 566 DELEGATE_TO_WEBCONTEXT_6(vertexAttribPointer, GC3Duint, GC3Dint, GC3Denum, GC3Db
oolean, GC3Dsizei, GC3Dintptr) |
| 572 | 567 |
| 573 DELEGATE_TO_WEBCONTEXT_4(viewport, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei) | 568 DELEGATE_TO_WEBCONTEXT_4(viewport, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei) |
| 574 | 569 |
| 575 void GraphicsContext3D::reshape(int width, int height) | |
| 576 { | |
| 577 if (width == m_impl->width() && height == m_impl->height()) | |
| 578 return; | |
| 579 | |
| 580 m_impl->reshape(width, height); | |
| 581 } | |
| 582 | |
| 583 void GraphicsContext3D::markContextChanged() | 570 void GraphicsContext3D::markContextChanged() |
| 584 { | 571 { |
| 585 m_layerComposited = false; | 572 m_layerComposited = false; |
| 586 } | 573 } |
| 587 | 574 |
| 588 bool GraphicsContext3D::layerComposited() const | 575 bool GraphicsContext3D::layerComposited() const |
| 589 { | 576 { |
| 590 return m_layerComposited; | 577 return m_layerComposited; |
| 591 } | 578 } |
| 592 | 579 |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 for (unsigned i = 0; i < count; i++) { | 1003 for (unsigned i = 0; i < count; i++) { |
| 1017 uint8* rowA = framebuffer + i * rowBytes; | 1004 uint8* rowA = framebuffer + i * rowBytes; |
| 1018 uint8* rowB = framebuffer + (height - i - 1) * rowBytes; | 1005 uint8* rowB = framebuffer + (height - i - 1) * rowBytes; |
| 1019 memcpy(scanline, rowB, rowBytes); | 1006 memcpy(scanline, rowB, rowBytes); |
| 1020 memcpy(rowB, rowA, rowBytes); | 1007 memcpy(rowB, rowA, rowBytes); |
| 1021 memcpy(rowA, scanline, rowBytes); | 1008 memcpy(rowA, scanline, rowBytes); |
| 1022 } | 1009 } |
| 1023 } | 1010 } |
| 1024 | 1011 |
| 1025 } // namespace WebCore | 1012 } // namespace WebCore |
| OLD | NEW |