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

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

Issue 2267993002: Expose if we are using swiftshader via WebGraphicsContext3DProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: softwarerendering: . Created 4 years, 3 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 }; 242 };
243 243
244 class WebGraphicsContext3DProviderForTests : public WebGraphicsContext3DProvider { 244 class WebGraphicsContext3DProviderForTests : public WebGraphicsContext3DProvider {
245 public: 245 public:
246 WebGraphicsContext3DProviderForTests(std::unique_ptr<gpu::gles2::GLES2Interf ace> gl) 246 WebGraphicsContext3DProviderForTests(std::unique_ptr<gpu::gles2::GLES2Interf ace> gl)
247 : m_gl(std::move(gl)) 247 : m_gl(std::move(gl))
248 { 248 {
249 } 249 }
250 250
251 gpu::gles2::GLES2Interface* contextGL() override { return m_gl.get(); } 251 gpu::gles2::GLES2Interface* contextGL() override { return m_gl.get(); }
252 bool isSoftwareRendering() const override { return false; }
253
252 // Not used by WebGL code. 254 // Not used by WebGL code.
253 GrContext* grContext() override { return nullptr; } 255 GrContext* grContext() override { return nullptr; }
254 bool bindToCurrentThread() override { return false; } 256 bool bindToCurrentThread() override { return false; }
255 gpu::Capabilities getCapabilities() 257 gpu::Capabilities getCapabilities() override { return gpu::Capabilities(); }
256 {
257 return gpu::Capabilities();
258 }
259 void setLostContextCallback(WebClosure) {} 258 void setLostContextCallback(WebClosure) {}
260 void setErrorMessageCallback(WebFunction<void(const char*, int32_t id)>) {} 259 void setErrorMessageCallback(WebFunction<void(const char*, int32_t id)>) {}
261 260
262 private: 261 private:
263 std::unique_ptr<gpu::gles2::GLES2Interface> m_gl; 262 std::unique_ptr<gpu::gles2::GLES2Interface> m_gl;
264 }; 263 };
265 264
266 class DrawingBufferTest : public Test { 265 class DrawingBufferTest : public Test {
267 protected: 266 protected:
268 void SetUp() override 267 void SetUp() override
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 m_drawingBuffer->setIsHidden(true); 778 m_drawingBuffer->setIsHidden(true);
780 releaseCallback->Run(waitSyncToken, false /* lostResource */); 779 releaseCallback->Run(waitSyncToken, false /* lostResource */);
781 // m_drawingBuffer deletes mailbox immediately when hidden. 780 // m_drawingBuffer deletes mailbox immediately when hidden.
782 781
783 EXPECT_EQ(waitSyncToken, m_gl->mostRecentlyWaitedSyncToken()); 782 EXPECT_EQ(waitSyncToken, m_gl->mostRecentlyWaitedSyncToken());
784 783
785 m_drawingBuffer->beginDestruction(); 784 m_drawingBuffer->beginDestruction();
786 } 785 }
787 786
788 } // namespace blink 787 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698