| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 GLuint framebuffer() const; | 151 GLuint framebuffer() const; |
| 152 | 152 |
| 153 bool discardFramebufferSupported() const { return m_discardFramebufferSuppor
ted; } | 153 bool discardFramebufferSupported() const { return m_discardFramebufferSuppor
ted; } |
| 154 | 154 |
| 155 void markContentsChanged(); | 155 void markContentsChanged(); |
| 156 void setBufferClearNeeded(bool); | 156 void setBufferClearNeeded(bool); |
| 157 bool bufferClearNeeded() const; | 157 bool bufferClearNeeded() const; |
| 158 void setIsHidden(bool); | 158 void setIsHidden(bool); |
| 159 void setFilterQuality(SkFilterQuality); | 159 void setFilterQuality(SkFilterQuality); |
| 160 | 160 |
| 161 // Indicates that the currently bound framebuffer has internalformat |
| 162 // GL_RGBA, but is emulating GL_RGB. This happens to the backbuffer when the |
| 163 // client requests alpha:False, but GL_RGB textures are unusable because of |
| 164 // driver bugs. |
| 165 bool requiresRGBEmulation(); |
| 166 |
| 161 WebLayer* platformLayer(); | 167 WebLayer* platformLayer(); |
| 162 | 168 |
| 163 WebGraphicsContext3D* context(); | 169 WebGraphicsContext3D* context(); |
| 164 gpu::gles2::GLES2Interface* contextGL(); | 170 gpu::gles2::GLES2Interface* contextGL(); |
| 165 WebGraphicsContext3DProvider* contextProvider(); | 171 WebGraphicsContext3DProvider* contextProvider(); |
| 166 | 172 |
| 167 // WebExternalTextureLayerClient implementation. | 173 // WebExternalTextureLayerClient implementation. |
| 168 bool prepareMailbox(WebExternalTextureMailbox*, WebExternalBitmap*) override
; | 174 bool prepareMailbox(WebExternalTextureMailbox*, WebExternalBitmap*) override
; |
| 169 void mailboxReleased(const WebExternalTextureMailbox&, bool lostResource = f
alse) override; | 175 void mailboxReleased(const WebExternalTextureMailbox&, bool lostResource = f
alse) override; |
| 170 | 176 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 291 |
| 286 // Helper function to flip a bitmap vertically. | 292 // Helper function to flip a bitmap vertically. |
| 287 void flipVertically(uint8_t* data, int width, int height); | 293 void flipVertically(uint8_t* data, int width, int height); |
| 288 | 294 |
| 289 // Helper to texImage2D with pixel==0 case: pixels are initialized to 0. | 295 // Helper to texImage2D with pixel==0 case: pixels are initialized to 0. |
| 290 // By default, alignment is 4, the OpenGL default setting. | 296 // By default, alignment is 4, the OpenGL default setting. |
| 291 void texImage2DResourceSafe(GLenum target, GLint level, GLenum internalforma
t, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLin
t alignment = 4); | 297 void texImage2DResourceSafe(GLenum target, GLint level, GLenum internalforma
t, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLin
t alignment = 4); |
| 292 // Allocate buffer storage to be sent to compositor using either texImage2D
or CHROMIUM_image based on available support. | 298 // Allocate buffer storage to be sent to compositor using either texImage2D
or CHROMIUM_image based on available support. |
| 293 void deleteChromiumImageForTexture(TextureInfo*); | 299 void deleteChromiumImageForTexture(TextureInfo*); |
| 294 | 300 |
| 301 // If RGB emulation is required, then the CHROMIUM image must be immediately |
| 302 // cleared after it is bound to a texture. |
| 303 void clearChromiumImageIfNecessary(const TextureInfo&); |
| 304 |
| 295 // Tries to create a CHROMIUM_image backed texture if | 305 // Tries to create a CHROMIUM_image backed texture if |
| 296 // RuntimeEnabledFeatures::webGLImageChromiumEnabled() is true. On failure, | 306 // RuntimeEnabledFeatures::webGLImageChromiumEnabled() is true. On failure, |
| 297 // or if the flag is false, creates a default texture. | 307 // or if the flag is false, creates a default texture. |
| 298 TextureInfo createTextureAndAllocateMemory(const IntSize&); | 308 TextureInfo createTextureAndAllocateMemory(const IntSize&); |
| 299 | 309 |
| 300 // Creates and allocates space for a default texture. | 310 // Creates and allocates space for a default texture. |
| 301 TextureInfo createDefaultTextureAndAllocateMemory(const IntSize&); | 311 TextureInfo createDefaultTextureAndAllocateMemory(const IntSize&); |
| 302 | 312 |
| 303 void resizeTextureMemory(TextureInfo*, const IntSize&); | 313 void resizeTextureMemory(TextureInfo*, const IntSize&); |
| 304 | 314 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 // used to resize the Canvas. | 385 // used to resize the Canvas. |
| 376 SkBitmap m_resizingBitmap; | 386 SkBitmap m_resizingBitmap; |
| 377 | 387 |
| 378 // Used to flip a bitmap vertically. | 388 // Used to flip a bitmap vertically. |
| 379 Vector<uint8_t> m_scanline; | 389 Vector<uint8_t> m_scanline; |
| 380 }; | 390 }; |
| 381 | 391 |
| 382 } // namespace blink | 392 } // namespace blink |
| 383 | 393 |
| 384 #endif // DrawingBuffer_h | 394 #endif // DrawingBuffer_h |
| OLD | NEW |