Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h

Issue 2267993002: Expose if we are using swiftshader via WebGraphicsContext3DProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: softwarerendering: . Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 gpu::gles2::GLES2Interface* contextGL(); 206 gpu::gles2::GLES2Interface* contextGL();
207 WebGraphicsContext3DProvider* contextProvider(); 207 WebGraphicsContext3DProvider* contextProvider();
208 208
209 // cc::TextureLayerClient implementation. 209 // cc::TextureLayerClient implementation.
210 bool PrepareTextureMailbox( 210 bool PrepareTextureMailbox(
211 cc::TextureMailbox* outMailbox, 211 cc::TextureMailbox* outMailbox,
212 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback, 212 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback,
213 bool useSharedMemory) override; 213 bool useSharedMemory) override;
214 214
215 // Callbacks for mailboxes given to the compositor from PrepareTextureMailbo x.
216 void gpuMailboxReleased(const gpu::Mailbox&, const gpu::SyncToken&, bool los tResource);
217 void softwareMailboxReleased(std::unique_ptr<cc::SharedBitmap>, const IntSiz e&, const gpu::SyncToken&, bool lostResource);
218
219 // Returns a StaticBitmapImage backed by a texture containing the/ current c ontents of 215 // Returns a StaticBitmapImage backed by a texture containing the/ current c ontents of
220 // the front buffer. This is done without any pixel copies. The texture in t he ImageBitmap 216 // the front buffer. This is done without any pixel copies. The texture in t he ImageBitmap
221 // is from the active ContextProvider on the DrawingBuffer. 217 // is from the active ContextProvider on the DrawingBuffer.
222 PassRefPtr<StaticBitmapImage> transferToStaticBitmapImage(); 218 PassRefPtr<StaticBitmapImage> transferToStaticBitmapImage();
223 219
224 // Destroys the TEXTURE_2D binding for the owned context 220 // Destroys the TEXTURE_2D binding for the owned context
225 bool copyToPlatformTexture(gpu::gles2::GLES2Interface*, GLuint texture, GLen um internalFormat, 221 bool copyToPlatformTexture(gpu::gles2::GLES2Interface*, GLuint texture, GLen um internalFormat,
226 GLenum destType, GLint level, bool premultiplyAlpha, bool flipY, SourceD rawingBuffer); 222 GLenum destType, GLint level, bool premultiplyAlpha, bool flipY, SourceD rawingBuffer);
227 223
228 void setPackAlignment(GLint param); 224 void setPackAlignment(GLint param);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 struct MailboxInfo : public RefCounted<MailboxInfo> { 278 struct MailboxInfo : public RefCounted<MailboxInfo> {
283 MailboxInfo() = default; 279 MailboxInfo() = default;
284 gpu::Mailbox mailbox; 280 gpu::Mailbox mailbox;
285 TextureInfo textureInfo; 281 TextureInfo textureInfo;
286 IntSize size; 282 IntSize size;
287 283
288 private: 284 private:
289 WTF_MAKE_NONCOPYABLE(MailboxInfo); 285 WTF_MAKE_NONCOPYABLE(MailboxInfo);
290 }; 286 };
291 287
288 bool prepareTextureMailboxInternal(
289 cc::TextureMailbox* outMailbox,
290 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback,
291 bool forceGpuResult);
292
293 // Callbacks for mailboxes given to the compositor from PrepareTextureMailbo x.
294 void gpuMailboxReleased(const gpu::Mailbox&, const gpu::SyncToken&, bool los tResource);
295 void softwareMailboxReleased(std::unique_ptr<cc::SharedBitmap>, const IntSiz e&, const gpu::SyncToken&, bool lostResource);
296
292 // The texture parameters to use for a texture that will be backed by a 297 // The texture parameters to use for a texture that will be backed by a
293 // CHROMIUM_image. 298 // CHROMIUM_image.
294 TextureParameters chromiumImageTextureParameters(); 299 TextureParameters chromiumImageTextureParameters();
295 300
296 // The texture parameters to use for a default texture. 301 // The texture parameters to use for a default texture.
297 TextureParameters defaultTextureParameters(); 302 TextureParameters defaultTextureParameters();
298 303
299 // Creates and binds a texture with the given parameters. Returns 0 on 304 // Creates and binds a texture with the given parameters. Returns 0 on
300 // failure, or the newly created texture id on success. The caller takes 305 // failure, or the newly created texture id on success. The caller takes
301 // ownership of the newly created texture. 306 // ownership of the newly created texture.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 GLboolean m_colorMask[4]; 386 GLboolean m_colorMask[4];
382 387
383 std::unique_ptr<WebGraphicsContext3DProvider> m_contextProvider; 388 std::unique_ptr<WebGraphicsContext3DProvider> m_contextProvider;
384 // Lifetime is tied to the m_contextProvider. 389 // Lifetime is tied to the m_contextProvider.
385 gpu::gles2::GLES2Interface* m_gl; 390 gpu::gles2::GLES2Interface* m_gl;
386 std::unique_ptr<Extensions3DUtil> m_extensionsUtil; 391 std::unique_ptr<Extensions3DUtil> m_extensionsUtil;
387 IntSize m_size = { -1, -1 }; 392 IntSize m_size = { -1, -1 };
388 const bool m_discardFramebufferSupported; 393 const bool m_discardFramebufferSupported;
389 const bool m_wantAlphaChannel; 394 const bool m_wantAlphaChannel;
390 const bool m_premultipliedAlpha; 395 const bool m_premultipliedAlpha;
396 const bool m_softwareRendering;
391 bool m_hasImplicitStencilBuffer = false; 397 bool m_hasImplicitStencilBuffer = false;
392 bool m_storageTextureSupported = false; 398 bool m_storageTextureSupported = false;
393 struct FrontBufferInfo { 399 struct FrontBufferInfo {
394 gpu::Mailbox mailbox; 400 gpu::Mailbox mailbox;
395 gpu::SyncToken produceSyncToken; 401 gpu::SyncToken produceSyncToken;
396 TextureInfo texInfo; 402 TextureInfo texInfo;
397 }; 403 };
398 FrontBufferInfo m_frontColorBuffer; 404 FrontBufferInfo m_frontColorBuffer;
399 405
400 std::unique_ptr<WTF::Closure> m_newMailboxCallback; 406 std::unique_ptr<WTF::Closure> m_newMailboxCallback;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 // used to resize the Canvas. 484 // used to resize the Canvas.
479 SkBitmap m_resizingBitmap; 485 SkBitmap m_resizingBitmap;
480 486
481 // Used to flip a bitmap vertically. 487 // Used to flip a bitmap vertically.
482 Vector<uint8_t> m_scanline; 488 Vector<uint8_t> m_scanline;
483 }; 489 };
484 490
485 } // namespace blink 491 } // namespace blink
486 492
487 #endif // DrawingBuffer_h 493 #endif // DrawingBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698