| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 }; | 88 }; |
| 89 public: | 89 public: |
| 90 enum PreserveDrawingBuffer { | 90 enum PreserveDrawingBuffer { |
| 91 Preserve, | 91 Preserve, |
| 92 Discard | 92 Discard |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 static PassRefPtr<DrawingBuffer> create(PassOwnPtr<WebGraphicsContext3D>, co
nst IntSize&, PreserveDrawingBuffer, WebGraphicsContext3D::Attributes requestedA
ttributes); | 95 static PassRefPtr<DrawingBuffer> create(PassOwnPtr<WebGraphicsContext3D>, co
nst IntSize&, PreserveDrawingBuffer, WebGraphicsContext3D::Attributes requestedA
ttributes); |
| 96 static void forceNextDrawingBufferCreationToFail(); | 96 static void forceNextDrawingBufferCreationToFail(); |
| 97 | 97 |
| 98 virtual ~DrawingBuffer(); | 98 ~DrawingBuffer() override; |
| 99 | 99 |
| 100 // Destruction will be completed after all mailboxes are released. | 100 // Destruction will be completed after all mailboxes are released. |
| 101 void beginDestruction(); | 101 void beginDestruction(); |
| 102 | 102 |
| 103 // Issues a glClear() on all framebuffers associated with this DrawingBuffer
. The caller is responsible for | 103 // Issues a glClear() on all framebuffers associated with this DrawingBuffer
. The caller is responsible for |
| 104 // making the context current and setting the clear values and masks. Modifi
es the framebuffer binding. | 104 // making the context current and setting the clear values and masks. Modifi
es the framebuffer binding. |
| 105 void clearFramebuffers(GLbitfield clearMask); | 105 void clearFramebuffers(GLbitfield clearMask); |
| 106 | 106 |
| 107 // Given the desired buffer size, provides the largest dimensions that will
fit in the pixel budget. | 107 // Given the desired buffer size, provides the largest dimensions that will
fit in the pixel budget. |
| 108 static IntSize adjustSize(const IntSize& desiredSize, const IntSize& curSize
, int maxTextureSize); | 108 static IntSize adjustSize(const IntSize& desiredSize, const IntSize& curSize
, int maxTextureSize); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 160 |
| 161 WebLayer* platformLayer(); | 161 WebLayer* platformLayer(); |
| 162 | 162 |
| 163 WebGraphicsContext3D* context(); | 163 WebGraphicsContext3D* context(); |
| 164 | 164 |
| 165 // Returns the actual context attributes for this drawing buffer which may d
iffer from the | 165 // Returns the actual context attributes for this drawing buffer which may d
iffer from the |
| 166 // requested context attributes due to implementation limits. | 166 // requested context attributes due to implementation limits. |
| 167 WebGraphicsContext3D::Attributes getActualAttributes() const { return m_actu
alAttributes; } | 167 WebGraphicsContext3D::Attributes getActualAttributes() const { return m_actu
alAttributes; } |
| 168 | 168 |
| 169 // WebExternalTextureLayerClient implementation. | 169 // WebExternalTextureLayerClient implementation. |
| 170 virtual bool prepareMailbox(WebExternalTextureMailbox*, WebExternalBitmap*)
override; | 170 bool prepareMailbox(WebExternalTextureMailbox*, WebExternalBitmap*) override
; |
| 171 virtual void mailboxReleased(const WebExternalTextureMailbox&, bool lostReso
urce = false) override; | 171 void mailboxReleased(const WebExternalTextureMailbox&, bool lostResource = f
alse) override; |
| 172 | 172 |
| 173 // Destroys the TEXTURE_2D binding for the owned context | 173 // Destroys the TEXTURE_2D binding for the owned context |
| 174 bool copyToPlatformTexture(WebGraphicsContext3D*, Platform3DObject texture,
GLenum internalFormat, | 174 bool copyToPlatformTexture(WebGraphicsContext3D*, Platform3DObject texture,
GLenum internalFormat, |
| 175 GLenum destType, GLint level, bool premultiplyAlpha, bool flipY, SourceD
rawingBuffer); | 175 GLenum destType, GLint level, bool premultiplyAlpha, bool flipY, SourceD
rawingBuffer); |
| 176 | 176 |
| 177 void setPackAlignment(GLint param); | 177 void setPackAlignment(GLint param); |
| 178 | 178 |
| 179 void paintRenderingResultsToCanvas(ImageBuffer*); | 179 void paintRenderingResultsToCanvas(ImageBuffer*); |
| 180 bool paintRenderingResultsToImageData(int&, int&, SourceDrawingBuffer, WTF::
ArrayBufferContents&); | 180 bool paintRenderingResultsToImageData(int&, int&, SourceDrawingBuffer, WTF::
ArrayBufferContents&); |
| 181 | 181 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // used to resize the Canvas. | 314 // used to resize the Canvas. |
| 315 SkBitmap m_resizingBitmap; | 315 SkBitmap m_resizingBitmap; |
| 316 | 316 |
| 317 // Used to flip a bitmap vertically. | 317 // Used to flip a bitmap vertically. |
| 318 Vector<uint8_t> m_scanline; | 318 Vector<uint8_t> m_scanline; |
| 319 }; | 319 }; |
| 320 | 320 |
| 321 } // namespace blink | 321 } // namespace blink |
| 322 | 322 |
| 323 #endif // DrawingBuffer_h | 323 #endif // DrawingBuffer_h |
| OLD | NEW |