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

Side by Side Diff: Source/core/html/canvas/WebGLRenderingContext.h

Issue 169933002: WebGL: Don't destroy mailbox textures in the destructor until they're released. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 // Lost context provoked by WEBKIT_lose_context. 311 // Lost context provoked by WEBKIT_lose_context.
312 SyntheticLostContext, 312 SyntheticLostContext,
313 313
314 // A synthetic lost context that should attempt to recover automatically 314 // A synthetic lost context that should attempt to recover automatically
315 AutoRecoverSyntheticLostContext 315 AutoRecoverSyntheticLostContext
316 }; 316 };
317 void forceLostContext(LostContextMode); 317 void forceLostContext(LostContextMode);
318 void forceRestoreContext(); 318 void forceRestoreContext();
319 void loseContextImpl(LostContextMode); 319 void loseContextImpl(LostContextMode);
320 320
321 blink::WebGraphicsContext3D* webGraphicsContext3D() const { return m_context .get(); } 321 blink::WebGraphicsContext3D* webGraphicsContext3D() const { return m_context ; }
322 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); } 322 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); }
323 virtual blink::WebLayer* platformLayer() const OVERRIDE; 323 virtual blink::WebLayer* platformLayer() const OVERRIDE;
324 Extensions3DUtil* extensionsUtil(); 324 Extensions3DUtil* extensionsUtil();
325 325
326 void reshape(int width, int height); 326 void reshape(int width, int height);
327 327
328 void markLayerComposited(); 328 void markLayerComposited();
329 virtual void paintRenderingResultsToCanvas() OVERRIDE; 329 virtual void paintRenderingResultsToCanvas() OVERRIDE;
330 PassRefPtr<ImageData> paintRenderingResultsToImageData(); 330 PassRefPtr<ImageData> paintRenderingResultsToImageData();
331 331
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 // Adds a compressed texture format. 378 // Adds a compressed texture format.
379 void addCompressedTextureFormat(GLenum); 379 void addCompressedTextureFormat(GLenum);
380 void removeAllCompressedTextureFormats(); 380 void removeAllCompressedTextureFormats();
381 381
382 PassRefPtr<Image> drawImageIntoBuffer(Image*, int width, int height); 382 PassRefPtr<Image> drawImageIntoBuffer(Image*, int width, int height);
383 383
384 PassRefPtr<Image> videoFrameToImage(HTMLVideoElement*, BackingStoreCopy); 384 PassRefPtr<Image> videoFrameToImage(HTMLVideoElement*, BackingStoreCopy);
385 385
386 WebGLRenderbuffer* ensureEmulatedStencilBuffer(GLenum target, WebGLRenderbuf fer*); 386 WebGLRenderbuffer* ensureEmulatedStencilBuffer(GLenum target, WebGLRenderbuf fer*);
387 387
388 OwnPtr<blink::WebGraphicsContext3D> m_context; 388 blink::WebGraphicsContext3D* m_context;
Justin Novosad 2014/02/18 18:07:33 IMHO: the ownership model would be clearer and mor
389 RefPtr<WebGLContextGroup> m_contextGroup; 389 RefPtr<WebGLContextGroup> m_contextGroup;
390 390
391 // Structure for rendering to a DrawingBuffer, instead of directly 391 // Structure for rendering to a DrawingBuffer, instead of directly
392 // to the back-buffer of m_context. 392 // to the back-buffer of m_context.
393 RefPtr<DrawingBuffer> m_drawingBuffer; 393 RefPtr<DrawingBuffer> m_drawingBuffer;
394 394
395 // Dispatches a context lost event once it is determined that one is needed. 395 // Dispatches a context lost event once it is determined that one is needed.
396 // This is used both for synthetic and real context losses. For real ones, i t's 396 // This is used both for synthetic and real context losses. For real ones, i t's
397 // likely that there's no JavaScript on the stack, but that might be depende nt 397 // likely that there's no JavaScript on the stack, but that might be depende nt
398 // on how exactly the platform discovers that the context was lost. For bett er 398 // on how exactly the platform discovers that the context was lost. For bett er
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 // If the vector is empty, return the maximum allowed active context number. 924 // If the vector is empty, return the maximum allowed active context number.
925 static size_t oldestContextIndex(); 925 static size_t oldestContextIndex();
926 static IntSize oldestContextSize(); 926 static IntSize oldestContextSize();
927 }; 927 };
928 928
929 DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context, contex t->is3d(), context.is3d()); 929 DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context, contex t->is3d(), context.is3d());
930 930
931 } // namespace WebCore 931 } // namespace WebCore
932 932
933 #endif 933 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/canvas/WebGLRenderingContext.cpp » ('j') | Source/platform/graphics/gpu/DrawingBuffer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698