https://bugs.webkit.org/show_bug.cgi?id=81279
Patch by Michal Mocny <mmocny@google.com> on 2012-03-19
Reviewed by James Robinson.
Source/Platform:
Adding a suggestHaveBackbuffer hint to the WebGraphicsContext3D memory allocation callback.
* chromium/public/WebGraphicsContext3D.h:
(WebGraphicsMemoryAllocationChangedCallbackCHROMIUM):
(WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM::onMemoryAllocationChanged):
* chromium/public/WebGraphicsMemoryAllocation.h: Added.
(WebKit):
(WebGraphicsMemoryAllocation):
(WebKit::WebGraphicsMemoryAllocation::WebGraphicsMemoryAllocation):
Source/WebCore:
* platform/graphics/chromium/Extensions3DChromium.h:
(GpuMemoryAllocationCHROMIUM):
(WebCore::Extensions3DChromium::GpuMemoryAllocationCHROMIUM::GpuMemoryAllocationCHROMIUM):
(GpuMemoryAllocationChangedCallbackCHROMIUM):
Source/WebKit/chromium:
* src/GraphicsContext3DChromium.cpp:
(WebCore::GrMemoryAllocationChangedCallback::onGpuMemoryAllocationChanged):
(WebCore::GraphicsContext3DMemoryAllocationChangedCallbackAdapter::onMemoryAllocationChanged):
(GraphicsContext3DMemoryAllocationChangedCallbackAdapter):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111216
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-03-19 Michal Mocny <mmocny@google.com>
+
+ [chromium] Updating WebGraphicsContext3D MemoryAllocation callback to accept a struct with have backbuffer suggestion.
+ https://bugs.webkit.org/show_bug.cgi?id=81279
+
+ Reviewed by James Robinson.
+
+ Adding a suggestHaveBackbuffer hint to the WebGraphicsContext3D memory allocation callback.
+
+ * chromium/public/WebGraphicsContext3D.h:
+ (WebGraphicsMemoryAllocationChangedCallbackCHROMIUM):
+ (WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM::onMemoryAllocationChanged):
+ * chromium/public/WebGraphicsMemoryAllocation.h: Added.
+ (WebKit):
+ (WebGraphicsMemoryAllocation):
+ (WebKit::WebGraphicsMemoryAllocation::WebGraphicsMemoryAllocation):
+
2012-03-19 David Reveman <reveman@chromium.org>
[Chromium] GL_EXT_occlusion_query_boolean and GL_CHROMIUM_command_buffer_query support.
#define WebGraphicsContext3D_h
#include "WebCommon.h"
+#include "WebGraphicsMemoryAllocation.h"
#include "WebNonCopyable.h"
#include "WebString.h"
class WebGraphicsMemoryAllocationChangedCallbackCHROMIUM {
public:
+ // FIXME: Remove this once we switch to WebGraphicsMemoryAllocation version.
virtual void onMemoryAllocationChanged(size_t gpuResourceSizeInBytes) = 0;
+ // FIXME: Make this pure virtual once we implement everywhere.
+ virtual void onMemoryAllocationChanged(WebGraphicsMemoryAllocation) { }
protected:
virtual ~WebGraphicsMemoryAllocationChangedCallbackCHROMIUM() { }
--- /dev/null
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebGraphicsMemoryAllocation_h
+#define WebGraphicsMemoryAllocation_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+struct WebGraphicsMemoryAllocation {
+ unsigned gpuResourceSizeInBytes;
+ bool suggestHaveBackbuffer;
+
+ WebGraphicsMemoryAllocation()
+ : gpuResourceSizeInBytes(0)
+ , suggestHaveBackbuffer(false)
+ {
+ }
+
+ WebGraphicsMemoryAllocation(unsigned gpuResourceSizeInBytes, bool suggestHaveBackbuffer)
+ : gpuResourceSizeInBytes(gpuResourceSizeInBytes)
+ , suggestHaveBackbuffer(suggestHaveBackbuffer)
+ {
+ }
+};
+
+} // namespace WebKit
+
+#endif
+
+2012-03-19 Michal Mocny <mmocny@google.com>
+
+ [chromium] Updating WebGraphicsContext3D MemoryAllocation callback to accept a struct with have backbuffer suggestion.
+ https://bugs.webkit.org/show_bug.cgi?id=81279
+
+ Reviewed by James Robinson.
+
+ * platform/graphics/chromium/Extensions3DChromium.h:
+ (GpuMemoryAllocationCHROMIUM):
+ (WebCore::Extensions3DChromium::GpuMemoryAllocationCHROMIUM::GpuMemoryAllocationCHROMIUM):
+ (GpuMemoryAllocationChangedCallbackCHROMIUM):
+
2012-03-19 Tony Chang <tony@chromium.org>
flex-item-align: stretch should only grow, never shrink
void setVisibilityCHROMIUM(bool);
// GL_CHROMIUM_gpu_memory_manager
+ struct GpuMemoryAllocationCHROMIUM {
+ size_t gpuResourceSizeInBytes;
+ bool suggestHaveBackbuffer;
+
+ GpuMemoryAllocationCHROMIUM(size_t gpuResourceSizeInBytes, bool suggestHaveBackbuffer)
+ : gpuResourceSizeInBytes(gpuResourceSizeInBytes)
+ , suggestHaveBackbuffer(suggestHaveBackbuffer)
+ {
+ }
+ };
class GpuMemoryAllocationChangedCallbackCHROMIUM {
public:
- virtual void onGpuMemoryAllocationChanged(size_t gpuResourceSizeInBytes) = 0;
+
+ virtual void onGpuMemoryAllocationChanged(GpuMemoryAllocationCHROMIUM) = 0;
virtual ~GpuMemoryAllocationChangedCallbackCHROMIUM() { }
};
void setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<GpuMemoryAllocationChangedCallbackCHROMIUM>);
+2012-03-19 Michal Mocny <mmocny@google.com>
+
+ [chromium] Updating WebGraphicsContext3D MemoryAllocation callback to accept a struct with have backbuffer suggestion.
+ https://bugs.webkit.org/show_bug.cgi?id=81279
+
+ Reviewed by James Robinson.
+
+ * src/GraphicsContext3DChromium.cpp:
+ (WebCore::GrMemoryAllocationChangedCallback::onGpuMemoryAllocationChanged):
+ (WebCore::GraphicsContext3DMemoryAllocationChangedCallbackAdapter::onMemoryAllocationChanged):
+ (GraphicsContext3DMemoryAllocationChangedCallbackAdapter):
+
2012-03-19 David Reveman <reveman@chromium.org>
[Chromium] GL_EXT_occlusion_query_boolean and GL_CHROMIUM_command_buffer_query support.
{
}
- virtual void onGpuMemoryAllocationChanged(size_t gpuResourceSizeInBytes)
+ virtual void onGpuMemoryAllocationChanged(Extensions3DChromium::GpuMemoryAllocationCHROMIUM allocation)
{
GrContext* context = m_context->grContext();
if (!context)
return;
- if (!gpuResourceSizeInBytes) {
+ if (!allocation.gpuResourceSizeInBytes) {
context->freeGpuResources();
context->setTextureCacheLimits(0, 0);
} else
virtual ~GraphicsContext3DMemoryAllocationChangedCallbackAdapter() { }
virtual void onMemoryAllocationChanged(size_t gpuResourceSizeInBytes)
+ {
+ // FIXME: Remove this once clients start using WebGraphicsMemoryAllocation exclusively.
+ onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation(gpuResourceSizeInBytes, true));
+ }
+
+ virtual void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation allocation)
{
if (m_memoryAllocationChangedCallback)
- m_memoryAllocationChangedCallback->onGpuMemoryAllocationChanged(gpuResourceSizeInBytes);
+ m_memoryAllocationChangedCallback->onGpuMemoryAllocationChanged(Extensions3DChromium::GpuMemoryAllocationCHROMIUM(allocation.gpuResourceSizeInBytes, allocation.suggestHaveBackbuffer));
}
private: