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

Side by Side Diff: ui/ozone/platform/drm/gpu/mock_scanout_buffer_generator.h

Issue 2712463002: ozone: Reject overlays when a test buffer can't be allocated. (Closed)
Patch Set: Remove DCHECK that one plane would always succeed. Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef UI_OZONE_PLATFORM_DRM_GPU_MOCK_SCANOUT_BUFFER_GENERATOR_H_ 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_MOCK_SCANOUT_BUFFER_GENERATOR_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_MOCK_SCANOUT_BUFFER_GENERATOR_H_ 6 #define UI_OZONE_PLATFORM_DRM_GPU_MOCK_SCANOUT_BUFFER_GENERATOR_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 9
10 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" 10 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h"
11 11
12 namespace ui { 12 namespace ui {
13 13
14 class MockScanoutBufferGenerator : public ScanoutBufferGenerator { 14 class MockScanoutBufferGenerator : public ScanoutBufferGenerator {
15 public: 15 public:
16 MockScanoutBufferGenerator(); 16 MockScanoutBufferGenerator();
17 ~MockScanoutBufferGenerator() override; 17 ~MockScanoutBufferGenerator() override;
18 18
19 // ScanoutBufferGenerator: 19 // ScanoutBufferGenerator:
20 scoped_refptr<ScanoutBuffer> Create(const scoped_refptr<DrmDevice>& drm, 20 scoped_refptr<ScanoutBuffer> Create(const scoped_refptr<DrmDevice>& drm,
21 uint32_t format, 21 uint32_t format,
22 const gfx::Size& size) override; 22 const gfx::Size& size) override;
23 23
24 void set_allocation_failure(bool allocation_failure) {
25 allocation_failure_ = allocation_failure;
26 }
27
24 private: 28 private:
25 DISALLOW_COPY_AND_ASSIGN(MockScanoutBufferGenerator); 29 DISALLOW_COPY_AND_ASSIGN(MockScanoutBufferGenerator);
30
31 bool allocation_failure_ = false;
26 }; 32 };
27 33
28 } // namespace ui 34 } // namespace ui
29 35
30 #endif // UI_OZONE_PLATFORM_DRM_GPU_MOCK_SCANOUT_BUFFER_GENERATOR_H_ 36 #endif // UI_OZONE_PLATFORM_DRM_GPU_MOCK_SCANOUT_BUFFER_GENERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698