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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp

Issue 2643343002: DrawingBuffer: Use gfx::GpuMemoryBuffer directly and set color space (Closed)
Patch Set: Fix buffer format Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
index 184a278d2d0a5d5408066a8a18bb8109a92753ef..6f6a6b98fe8b7839d2f545c834779a99d6b5e3da 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
@@ -32,6 +32,7 @@
#include "cc/resources/single_release_callback.h"
#include "cc/resources/texture_mailbox.h"
+#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "gpu/command_buffer/client/gles2_interface_stub.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/sync_token.h"
@@ -40,6 +41,7 @@
#include "platform/graphics/gpu/DrawingBufferTestHelpers.h"
#include "public/platform/Platform.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h"
#include "wtf/PtrUtil.h"
#include "wtf/RefPtr.h"
#include <memory>
@@ -49,6 +51,19 @@ using testing::_;
namespace blink {
+namespace {
+
+class FakePlatformSupport : public TestingPlatformSupport {
+ gpu::GpuMemoryBufferManager* getGpuMemoryBufferManager() override {
+ return &m_testGpuMemoryBufferManager;
+ }
+
+ private:
+ cc::TestGpuMemoryBufferManager m_testGpuMemoryBufferManager;
+};
+
+} // anonymous namespace
+
class DrawingBufferTest : public Test {
protected:
void SetUp() override {
@@ -346,6 +361,8 @@ TEST_F(DrawingBufferTest, verifyInsertAndWaitSyncTokenCorrectly) {
class DrawingBufferImageChromiumTest : public DrawingBufferTest {
protected:
void SetUp() override {
+ m_platform.reset(new ScopedTestingPlatformSupport<FakePlatformSupport>);
+
IntSize initialSize(InitialWidth, InitialHeight);
std::unique_ptr<GLES2InterfaceForTests> gl =
WTF::wrapUnique(new GLES2InterfaceForTests);
@@ -365,9 +382,11 @@ class DrawingBufferImageChromiumTest : public DrawingBufferTest {
void TearDown() override {
RuntimeEnabledFeatures::setWebGLImageChromiumEnabled(false);
+ m_platform.reset();
}
GLuint m_imageId0;
+ std::unique_ptr<ScopedTestingPlatformSupport<FakePlatformSupport>> m_platform;
};
TEST_F(DrawingBufferImageChromiumTest, verifyResizingReallocatesImages) {

Powered by Google App Engine
This is Rietveld 408576698