When enabling new profile management programmatically, make sure to set the
[chromium-blink-merge.git] / content / browser / compositor / onscreen_display_client.h
blob7ab6ff7d02b4e8800ccd8b0765838d867411c586
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_COMPOSITOR_ONSCREEN_DISPLAY_CLIENT_H_
6 #define CONTENT_BROWSER_COMPOSITOR_ONSCREEN_DISPLAY_CLIENT_H_
8 #include "cc/surfaces/display_client.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "cc/surfaces/display.h"
14 namespace cc {
15 class ContextProvider;
16 class SurfaceManager;
19 namespace content {
21 // This class provides a DisplayClient implementation for drawing directly to an
22 // onscreen context.
23 class OnscreenDisplayClient : cc::DisplayClient {
24 public:
25 OnscreenDisplayClient(
26 const scoped_refptr<cc::ContextProvider>& onscreen_context_provider,
27 scoped_ptr<cc::OutputSurface> software_surface,
28 cc::SurfaceManager* manager);
29 virtual ~OnscreenDisplayClient();
31 cc::Display* display() { return &display_; }
33 // cc::DisplayClient implementation.
34 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface() OVERRIDE;
36 private:
37 scoped_refptr<cc::ContextProvider> onscreen_context_provider_;
38 scoped_ptr<cc::OutputSurface> software_surface_;
39 cc::Display display_;
41 DISALLOW_COPY_AND_ASSIGN(OnscreenDisplayClient);
44 } // namespace content
46 #endif // CONTENT_BROWSER_COMPOSITOR_ONSCREEN_DISPLAY_CLIENT_H_