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

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

Issue 1830033003: Make lost context callback a base::Closure thru the WGC3DProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lostcontext-webclosure: no-lambdas-sadface Created 4 years, 9 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 22 matching lines...) Expand all
33 #include "gpu/command_buffer/client/gles2_interface_stub.h" 33 #include "gpu/command_buffer/client/gles2_interface_stub.h"
34 #include "platform/RuntimeEnabledFeatures.h" 34 #include "platform/RuntimeEnabledFeatures.h"
35 #include "platform/graphics/ImageBuffer.h" 35 #include "platform/graphics/ImageBuffer.h"
36 #include "platform/graphics/UnacceleratedImageBufferSurface.h" 36 #include "platform/graphics/UnacceleratedImageBufferSurface.h"
37 #include "platform/graphics/gpu/Extensions3DUtil.h" 37 #include "platform/graphics/gpu/Extensions3DUtil.h"
38 #include "platform/graphics/test/MockWebGraphicsContext3D.h" 38 #include "platform/graphics/test/MockWebGraphicsContext3D.h"
39 #include "public/platform/Platform.h" 39 #include "public/platform/Platform.h"
40 #include "public/platform/WebExternalTextureMailbox.h" 40 #include "public/platform/WebExternalTextureMailbox.h"
41 #include "public/platform/WebGraphicsContext3D.h" 41 #include "public/platform/WebGraphicsContext3D.h"
42 #include "public/platform/WebGraphicsContext3DProvider.h" 42 #include "public/platform/WebGraphicsContext3DProvider.h"
43 #include "public/platform/callback/WebClosure.h"
43 #include "testing/gmock/include/gmock/gmock.h" 44 #include "testing/gmock/include/gmock/gmock.h"
44 #include "testing/gtest/include/gtest/gtest.h" 45 #include "testing/gtest/include/gtest/gtest.h"
45 #include "wtf/RefPtr.h" 46 #include "wtf/RefPtr.h"
46 47
47 using testing::Test; 48 using testing::Test;
48 using testing::_; 49 using testing::_;
49 50
50 namespace blink { 51 namespace blink {
51 52
52 namespace { 53 namespace {
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 WebGraphicsContext3DProviderForTests(PassOwnPtr<WebGraphicsContext3D> contex t, PassOwnPtr<gpu::gles2::GLES2Interface> gl) 268 WebGraphicsContext3DProviderForTests(PassOwnPtr<WebGraphicsContext3D> contex t, PassOwnPtr<gpu::gles2::GLES2Interface> gl)
268 : m_context(std::move(context)) 269 : m_context(std::move(context))
269 , m_gl(std::move(gl)) 270 , m_gl(std::move(gl))
270 { 271 {
271 } 272 }
272 273
273 WebGraphicsContext3D* context3d() override { return m_context.get(); } 274 WebGraphicsContext3D* context3d() override { return m_context.get(); }
274 gpu::gles2::GLES2Interface* contextGL() override { return m_gl.get(); } 275 gpu::gles2::GLES2Interface* contextGL() override { return m_gl.get(); }
275 // Not used by WebGL code. 276 // Not used by WebGL code.
276 GrContext* grContext() override { return nullptr; } 277 GrContext* grContext() override { return nullptr; }
278 void setLostContextCallback(WebClosure) {}
277 279
278 private: 280 private:
279 OwnPtr<WebGraphicsContext3D> m_context; 281 OwnPtr<WebGraphicsContext3D> m_context;
280 OwnPtr<gpu::gles2::GLES2Interface> m_gl; 282 OwnPtr<gpu::gles2::GLES2Interface> m_gl;
281 }; 283 };
282 284
283 class DrawingBufferTest : public Test { 285 class DrawingBufferTest : public Test {
284 protected: 286 protected:
285 void SetUp() override 287 void SetUp() override
286 { 288 {
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 m_drawingBuffer->markContentsChanged(); 814 m_drawingBuffer->markContentsChanged();
813 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); 815 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
814 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); 816 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize());
815 EXPECT_FALSE(mailbox.allowOverlay); 817 EXPECT_FALSE(mailbox.allowOverlay);
816 818
817 m_drawingBuffer->mailboxReleased(mailbox, false); 819 m_drawingBuffer->mailboxReleased(mailbox, false);
818 m_drawingBuffer->beginDestruction(); 820 m_drawingBuffer->beginDestruction();
819 } 821 }
820 822
821 } // namespace blink 823 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698