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

Side by Side Diff: content/browser/compositor/buffer_queue_unittest.cc

Issue 1189943002: content: Fix lost context handling when using native GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: retry logic and remove singleton Created 5 years, 6 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <set> 5 #include <set>
6 6
7 #include "cc/test/test_context_provider.h" 7 #include "cc/test/test_context_provider.h"
8 #include "cc/test/test_web_graphics_context_3d.h" 8 #include "cc/test/test_web_graphics_context_3d.h"
9 #include "content/browser/compositor/buffer_queue.h" 9 #include "content/browser/compositor/buffer_queue.h"
10 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s urface.h" 10 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s urface.h"
(...skipping 24 matching lines...) Expand all
35 gfx::GpuMemoryBufferHandle GetHandle() const override { 35 gfx::GpuMemoryBufferHandle GetHandle() const override {
36 return gfx::GpuMemoryBufferHandle(); 36 return gfx::GpuMemoryBufferHandle();
37 } 37 }
38 ClientBuffer AsClientBuffer() override { 38 ClientBuffer AsClientBuffer() override {
39 return reinterpret_cast<ClientBuffer>(this); 39 return reinterpret_cast<ClientBuffer>(this);
40 } 40 }
41 }; 41 };
42 42
43 class StubBrowserGpuMemoryBufferManager : public BrowserGpuMemoryBufferManager { 43 class StubBrowserGpuMemoryBufferManager : public BrowserGpuMemoryBufferManager {
44 public: 44 public:
45 StubBrowserGpuMemoryBufferManager() 45 StubBrowserGpuMemoryBufferManager() : BrowserGpuMemoryBufferManager(1) {}
46 : BrowserGpuMemoryBufferManager(nullptr, 1) {}
47 46
48 scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBufferForScanout( 47 scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBufferForScanout(
49 const gfx::Size& size, 48 const gfx::Size& size,
50 gfx::GpuMemoryBuffer::Format format, 49 gfx::GpuMemoryBuffer::Format format,
51 int32 surface_id) override { 50 int32 surface_id) override {
52 return make_scoped_ptr<gfx::GpuMemoryBuffer>(new StubGpuMemoryBufferImpl); 51 return make_scoped_ptr<gfx::GpuMemoryBuffer>(new StubGpuMemoryBufferImpl);
53 } 52 }
54 }; 53 };
55 54
56 class MockBufferQueue : public BufferQueue { 55 class MockBufferQueue : public BufferQueue {
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 // All free buffers should be destroyed, the remaining buffers should all 536 // All free buffers should be destroyed, the remaining buffers should all
538 // be replaced but still valid. 537 // be replaced but still valid.
539 EXPECT_EQ(1U, in_flight_surfaces().size()); 538 EXPECT_EQ(1U, in_flight_surfaces().size());
540 EXPECT_EQ(0U, available_surfaces().size()); 539 EXPECT_EQ(0U, available_surfaces().size());
541 EXPECT_TRUE(displayed_frame().texture); 540 EXPECT_TRUE(displayed_frame().texture);
542 EXPECT_TRUE(current_frame().texture); 541 EXPECT_TRUE(current_frame().texture);
543 } 542 }
544 543
545 } // namespace 544 } // namespace
546 } // namespace content 545 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698