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

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

Issue 385663002: Revert of WebGL: Free temporary GPU resources held by inactive or hidden WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 class WebGLVertexArrayObjectOES; 95 class WebGLVertexArrayObjectOES;
96 96
97 class WebGLRenderingContextLostCallback; 97 class WebGLRenderingContextLostCallback;
98 class WebGLRenderingContextErrorMessageCallback; 98 class WebGLRenderingContextErrorMessageCallback;
99 99
100 class WebGLRenderingContextBase: public CanvasRenderingContext, public ActiveDOM Object, public Page::MultisamplingChangedObserver { 100 class WebGLRenderingContextBase: public CanvasRenderingContext, public ActiveDOM Object, public Page::MultisamplingChangedObserver {
101 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WebGLRenderingContextBase); 101 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WebGLRenderingContextBase);
102 public: 102 public:
103 virtual ~WebGLRenderingContextBase(); 103 virtual ~WebGLRenderingContextBase();
104 104
105 virtual bool is3d() const OVERRIDE { return true; }
106 virtual bool isAccelerated() const OVERRIDE { return true; }
105 virtual unsigned version() const = 0; 107 virtual unsigned version() const = 0;
106 virtual String contextName() const = 0; 108 virtual String contextName() const = 0;
107 virtual void registerContextExtensions() = 0; 109 virtual void registerContextExtensions() = 0;
108 110
109 static unsigned getWebGLVersion(const CanvasRenderingContext*); 111 static unsigned getWebGLVersion(const CanvasRenderingContext*);
110 112
111 int drawingBufferWidth() const; 113 int drawingBufferWidth() const;
112 int drawingBufferHeight() const; 114 int drawingBufferHeight() const;
113 115
114 void activeTexture(GLenum texture); 116 void activeTexture(GLenum texture);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 323
322 // A synthetic lost context that should attempt to recover automatically 324 // A synthetic lost context that should attempt to recover automatically
323 AutoRecoverSyntheticLostContext 325 AutoRecoverSyntheticLostContext
324 }; 326 };
325 void forceLostContext(LostContextMode); 327 void forceLostContext(LostContextMode);
326 void forceRestoreContext(); 328 void forceRestoreContext();
327 void loseContextImpl(LostContextMode); 329 void loseContextImpl(LostContextMode);
328 330
329 blink::WebGraphicsContext3D* webContext() const { return m_drawingBuffer->co ntext(); } 331 blink::WebGraphicsContext3D* webContext() const { return m_drawingBuffer->co ntext(); }
330 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); } 332 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); }
333 virtual blink::WebLayer* platformLayer() const OVERRIDE;
331 Extensions3DUtil* extensionsUtil(); 334 Extensions3DUtil* extensionsUtil();
332 335
333 void reshape(int width, int height); 336 void reshape(int width, int height);
334 337
335 void markLayerComposited(); 338 void markLayerComposited();
339 virtual void paintRenderingResultsToCanvas() OVERRIDE;
336 PassRefPtrWillBeRawPtr<ImageData> paintRenderingResultsToImageData(); 340 PassRefPtrWillBeRawPtr<ImageData> paintRenderingResultsToImageData();
337 341
338 void removeSharedObject(WebGLSharedObject*); 342 void removeSharedObject(WebGLSharedObject*);
339 void removeContextObject(WebGLContextObject*); 343 void removeContextObject(WebGLContextObject*);
340 344
341 unsigned maxVertexAttribs() const { return m_maxVertexAttribs; } 345 unsigned maxVertexAttribs() const { return m_maxVertexAttribs; }
342 346
343 // ActiveDOMObject notifications 347 // ActiveDOMObject notifications
344 virtual bool hasPendingActivity() const OVERRIDE; 348 virtual bool hasPendingActivity() const OVERRIDE;
345 virtual void stop() OVERRIDE; 349 virtual void stop() OVERRIDE;
(...skipping 11 matching lines...) Expand all
357 friend class WebGLCompressedTextureS3TC; 361 friend class WebGLCompressedTextureS3TC;
358 friend class WebGLRenderingContextErrorMessageCallback; 362 friend class WebGLRenderingContextErrorMessageCallback;
359 friend class WebGLVertexArrayObjectOES; 363 friend class WebGLVertexArrayObjectOES;
360 friend class ScopedTexture2DRestorer; 364 friend class ScopedTexture2DRestorer;
361 365
362 WebGLRenderingContextBase(HTMLCanvasElement*, PassOwnPtr<blink::WebGraphicsC ontext3D>, WebGLContextAttributes*); 366 WebGLRenderingContextBase(HTMLCanvasElement*, PassOwnPtr<blink::WebGraphicsC ontext3D>, WebGLContextAttributes*);
363 PassRefPtr<DrawingBuffer> createDrawingBuffer(PassOwnPtr<blink::WebGraphicsC ontext3D>); 367 PassRefPtr<DrawingBuffer> createDrawingBuffer(PassOwnPtr<blink::WebGraphicsC ontext3D>);
364 void initializeNewContext(); 368 void initializeNewContext();
365 void setupFlags(); 369 void setupFlags();
366 370
367 // CanvasRenderingContext implementation.
368 virtual bool is3d() const OVERRIDE { return true; }
369 virtual bool isAccelerated() const OVERRIDE { return true; }
370 virtual void setIsHidden(bool) OVERRIDE;
371 virtual void paintRenderingResultsToCanvas() OVERRIDE;
372 virtual blink::WebLayer* platformLayer() const OVERRIDE;
373
374 void addSharedObject(WebGLSharedObject*); 371 void addSharedObject(WebGLSharedObject*);
375 void addContextObject(WebGLContextObject*); 372 void addContextObject(WebGLContextObject*);
376 void detachAndRemoveAllObjects(); 373 void detachAndRemoveAllObjects();
377 374
378 void destroyContext(); 375 void destroyContext();
379 void markContextChanged(ContentChangeType); 376 void markContextChanged(ContentChangeType);
380 377
381 // Query if the GL implementation is NPOT strict. 378 // Query if the GL implementation is NPOT strict.
382 bool isGLES2NPOTStrict() { return m_isGLES2NPOTStrict; } 379 bool isGLES2NPOTStrict() { return m_isGLES2NPOTStrict; }
383 // Query if depth_stencil buffer is supported. 380 // Query if depth_stencil buffer is supported.
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 // If the vector is empty, return the maximum allowed active context number. 902 // If the vector is empty, return the maximum allowed active context number.
906 static size_t oldestContextIndex(); 903 static size_t oldestContextIndex();
907 static IntSize oldestContextSize(); 904 static IntSize oldestContextSize();
908 }; 905 };
909 906
910 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 907 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
911 908
912 } // namespace WebCore 909 } // namespace WebCore
913 910
914 #endif // WebGLRenderingContextBase_h 911 #endif // WebGLRenderingContextBase_h
OLDNEW
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698