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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 23 matching lines...) Expand all
34 #include "platform/graphics/UnacceleratedImageBufferSurface.h" 34 #include "platform/graphics/UnacceleratedImageBufferSurface.h"
35 #include "platform/graphics/test/MockGLES2Interface.h" 35 #include "platform/graphics/test/MockGLES2Interface.h"
36 #include "platform/graphics/test/MockWebGraphicsContext3D.h" 36 #include "platform/graphics/test/MockWebGraphicsContext3D.h"
37 #include "public/platform/Platform.h" 37 #include "public/platform/Platform.h"
38 #include "public/platform/WebExternalBitmap.h" 38 #include "public/platform/WebExternalBitmap.h"
39 #include "public/platform/WebGraphicsContext3DProvider.h" 39 #include "public/platform/WebGraphicsContext3DProvider.h"
40 #include "public/platform/WebScheduler.h" 40 #include "public/platform/WebScheduler.h"
41 #include "public/platform/WebTaskRunner.h" 41 #include "public/platform/WebTaskRunner.h"
42 #include "public/platform/WebThread.h" 42 #include "public/platform/WebThread.h"
43 #include "public/platform/WebTraceLocation.h" 43 #include "public/platform/WebTraceLocation.h"
44 #include "public/platform/callback/WebClosure.h"
44 #include "skia/ext/texture_handle.h" 45 #include "skia/ext/texture_handle.h"
45 #include "testing/gmock/include/gmock/gmock.h" 46 #include "testing/gmock/include/gmock/gmock.h"
46 #include "testing/gtest/include/gtest/gtest.h" 47 #include "testing/gtest/include/gtest/gtest.h"
47 #include "third_party/skia/include/core/SkCanvas.h" 48 #include "third_party/skia/include/core/SkCanvas.h"
48 #include "third_party/skia/include/gpu/GrContext.h" 49 #include "third_party/skia/include/gpu/GrContext.h"
49 #include "third_party/skia/include/gpu/gl/GrGLTypes.h" 50 #include "third_party/skia/include/gpu/gl/GrGLTypes.h"
50 #include "third_party/skia/include/gpu/gl/SkNullGLContext.h" 51 #include "third_party/skia/include/gpu/gl/SkNullGLContext.h"
51 #include "wtf/RefPtr.h" 52 #include "wtf/RefPtr.h"
52 53
53 using testing::AnyNumber; 54 using testing::AnyNumber;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 GrContext* grContext() override 88 GrContext* grContext() override
88 { 89 {
89 return m_grContext.get(); 90 return m_grContext.get();
90 } 91 }
91 92
92 gpu::gles2::GLES2Interface* contextGL() override 93 gpu::gles2::GLES2Interface* contextGL() override
93 { 94 {
94 return m_gl; 95 return m_gl;
95 } 96 }
96 97
98 void setLostContextCallback(WebClosure) override {}
99
97 private: 100 private:
98 WebGraphicsContext3D* m_context3d; 101 WebGraphicsContext3D* m_context3d;
99 gpu::gles2::GLES2Interface* m_gl; 102 gpu::gles2::GLES2Interface* m_gl;
100 RefPtr<GrContext> m_grContext; 103 RefPtr<GrContext> m_grContext;
101 }; 104 };
102 105
103 class Canvas2DLayerBridgePtr { 106 class Canvas2DLayerBridgePtr {
104 public: 107 public:
105 Canvas2DLayerBridgePtr() { } 108 Canvas2DLayerBridgePtr() { }
106 Canvas2DLayerBridgePtr(PassRefPtr<Canvas2DLayerBridge> layerBridge) 109 Canvas2DLayerBridgePtr(PassRefPtr<Canvas2DLayerBridge> layerBridge)
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 WebExternalTextureMailbox mailbox; 1127 WebExternalTextureMailbox mailbox;
1125 EXPECT_FALSE(bridge->prepareMailbox(&mailbox, 0)); 1128 EXPECT_FALSE(bridge->prepareMailbox(&mailbox, 0));
1126 EXPECT_TRUE(bridge->checkSurfaceValid()); 1129 EXPECT_TRUE(bridge->checkSurfaceValid());
1127 1130
1128 // Tear down the bridge on the thread so that 'bridge' can go out of scope 1131 // Tear down the bridge on the thread so that 'bridge' can go out of scope
1129 // without crashing due to thread checks 1132 // without crashing due to thread checks
1130 postAndWaitDestroyBridgeTask(BLINK_FROM_HERE, testThread.get(), &bridge); 1133 postAndWaitDestroyBridgeTask(BLINK_FROM_HERE, testThread.get(), &bridge);
1131 } 1134 }
1132 1135
1133 } // namespace blink 1136 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698