Skip to content
Permalink
Browse files
[chromium] Replace WGC3D visibility extension with resource_usage ext…
…ension. [Part 1 of 3]

https://bugs.webkit.org/show_bug.cgi?id=76634

Patch by Michal Mocny <mmocny@google.com> on 2012-01-19
Reviewed by Kenneth Russell.

* public/platform/WebGraphicsContext3D.h:
(WebKit::WebGraphicsContext3D::setVisibilityCHROMIUM):
(WebKit::WebGraphicsContext3D::setResourceUsageCHROMIUM):
* src/GraphicsContext3DChromium.cpp:
(WebCore::GraphicsContext3DPrivate::setVisibilityCHROMIUM):
* tests/FakeWebGraphicsContext3D.h:
(WebKit::FakeWebGraphicsContext3D::setResourceUsageCHROMIUM):

Canonical link: https://commits.webkit.org/93505@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Michal Mocny authored and webkit-commit-queue committed Jan 20, 2012
1 parent 4a61ced commit a633bcfe4f4b4a38470c163ab5db91e61e9227f5
@@ -1,3 +1,18 @@
2012-01-19 Michal Mocny <mmocny@google.com>

[chromium] Replace WGC3D visibility extension with resource_usage extension. [Part 1 of 3]
https://bugs.webkit.org/show_bug.cgi?id=76634

Reviewed by Kenneth Russell.

* public/platform/WebGraphicsContext3D.h:
(WebKit::WebGraphicsContext3D::setVisibilityCHROMIUM):
(WebKit::WebGraphicsContext3D::setResourceUsageCHROMIUM):
* src/GraphicsContext3DChromium.cpp:
(WebCore::GraphicsContext3DPrivate::setVisibilityCHROMIUM):
* tests/FakeWebGraphicsContext3D.h:
(WebKit::FakeWebGraphicsContext3D::setResourceUsageCHROMIUM):

2012-01-19 James Robinson <jamesr@chromium.org>

[chromium] Remove CCLayerDelegate, add ContentLayerDelegate for painting
@@ -124,6 +124,13 @@ class WebGraphicsContext3D : public WebNonCopyable {
virtual ~WebGraphicsSwapBuffersCompleteCallbackCHROMIUM() { }
};

// Graphics Resource Usage
enum ResourceUsage {
RESOURCE_USAGE_FULL,
RESOURCE_USAGE_LESS,
RESOURCE_USAGE_NONE,
};

// This destructor needs to be public so that using classes can destroy instances if initialization fails.
virtual ~WebGraphicsContext3D() {}

@@ -143,8 +150,10 @@ class WebGraphicsContext3D : public WebNonCopyable {
// Resizes the region into which this WebGraphicsContext3D is drawing.
virtual void reshape(int width, int height) = 0;

// GL_CHROMIUM_setVisibility - Changes the visibility of the backbuffer
virtual void setVisibilityCHROMIUM(bool visible) = 0;
// GL_CHROMIUM_resource_usage - use/drop various resources, such as front/back buffers
// TODO(mmocny): remove visibility once chromium patch lands
virtual void setVisibilityCHROMIUM(bool visible) { }
virtual void setResourceUsageCHROMIUM(ResourceUsage) { }

// Query whether it is built on top of compliant GLES2 implementation.
virtual bool isGLES2Compliant() = 0;
@@ -891,15 +891,20 @@ bool GraphicsContext3DPrivate::isExtensionEnabled(const String& name)
return m_enabledExtensions.contains(mappedName);
}

void GraphicsContext3DPrivate::setVisibilityCHROMIUM(bool visibility)
{
// TODO(mmocny): remove visibility once chromium patch lands
m_impl->setVisibilityCHROMIUM(visibility);
m_impl->setResourceUsageCHROMIUM(visibility ? WebKit::WebGraphicsContext3D::RESOURCE_USAGE_FULL : WebKit::WebGraphicsContext3D::RESOURCE_USAGE_LESS);
}

DELEGATE_TO_IMPL_4(postSubBufferCHROMIUM, int, int, int, int)

DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, GC3Denum, GC3Dsizeiptr, GC3Dsizei, GC3Denum, void*)
DELEGATE_TO_IMPL_1(unmapBufferSubDataCHROMIUM, const void*)
DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, GC3Denum, void*)
DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*)

DELEGATE_TO_IMPL_1(setVisibilityCHROMIUM, bool);

DELEGATE_TO_IMPL_10(blitFramebufferCHROMIUM, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dbitfield, GC3Denum)
DELEGATE_TO_IMPL_5(renderbufferStorageMultisampleCHROMIUM, GC3Denum, GC3Dsizei, GC3Denum, GC3Dsizei, GC3Dsizei)

@@ -63,7 +63,7 @@ class FakeWebGraphicsContext3D : public WebGraphicsContext3D {
virtual void* mapTexSubImage2DCHROMIUM(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, WGC3Denum access) { return 0; }
virtual void unmapTexSubImage2DCHROMIUM(const void*) { }

virtual void setVisibilityCHROMIUM(bool visible) { }
virtual void setResourceUsageCHROMIUM(ResourceUsage) { }

virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); }
virtual void requestExtensionCHROMIUM(const char*) { }

0 comments on commit a633bcf

Please sign in to comment.