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

Side by Side Diff: cc/output_surface.h

Issue 12545018: Move context-related callbacks into OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 CC_OUTPUT_SURFACE_H_ 5 #ifndef CC_OUTPUT_SURFACE_H_
6 #define CC_OUTPUT_SURFACE_H_ 6 #define CC_OUTPUT_SURFACE_H_
7 7
8 #define USE_CC_OUTPUT_SURFACE // TODO(danakj): Remove this. 8 #define USE_CC_OUTPUT_SURFACE // TODO(danakj): Remove this.
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "cc/cc_export.h" 12 #include "cc/cc_export.h"
13 #include "cc/software_output_device.h" 13 #include "cc/software_output_device.h"
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput Surface.h" 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput Surface.h"
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h"
16 16
17 namespace gfx { 17 namespace gfx {
18 class Rect; 18 class Rect;
19 class Size; 19 class Size;
20 } 20 }
21 21
22 namespace cc { 22 namespace cc {
23 23
24 class CompositorFrame; 24 class CompositorFrame;
25 class OutputSurfaceClient; 25 class OutputSurfaceClient;
26 class OutputSurfaceCallbacks;
26 27
27 // Represents the output surface for a compositor. The compositor owns 28 // Represents the output surface for a compositor. The compositor owns
28 // and manages its destruction. Its lifetime is: 29 // and manages its destruction. Its lifetime is:
29 // 1. Created on the main thread by the LayerTreeHost through its client. 30 // 1. Created on the main thread by the LayerTreeHost through its client.
30 // 2. Passed to the compositor thread and bound to a client via BindToClient. 31 // 2. Passed to the compositor thread and bound to a client via BindToClient.
31 // From here on, it will only be used on the compositor thread. 32 // From here on, it will only be used on the compositor thread.
32 // 3. If the 3D context is lost, then the compositor will delete the output 33 // 3. If the 3D context is lost, then the compositor will delete the output
33 // surface (on the compositor thread) and go back to step 1. 34 // surface (on the compositor thread) and go back to step 1.
34 class CC_EXPORT OutputSurface : public WebKit::WebCompositorOutputSurface { 35 class CC_EXPORT OutputSurface : public WebKit::WebCompositorOutputSurface {
35 public: 36 public:
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // processing should be stopped, or lowered in priority. 91 // processing should be stopped, or lowered in priority.
91 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} 92 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {}
92 93
93 protected: 94 protected:
94 OutputSurfaceClient* client_; 95 OutputSurfaceClient* client_;
95 struct cc::OutputSurface::Capabilities capabilities_; 96 struct cc::OutputSurface::Capabilities capabilities_;
96 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; 97 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_;
97 scoped_ptr<cc::SoftwareOutputDevice> software_device_; 98 scoped_ptr<cc::SoftwareOutputDevice> software_device_;
98 bool has_gl_discard_backbuffer_; 99 bool has_gl_discard_backbuffer_;
99 100
101 scoped_ptr<OutputSurfaceCallbacks> callbacks_;
piman 2013/03/08 05:11:56 nit: we probably want to have the callbacks outliv
102
100 private: 103 private:
101 DISALLOW_COPY_AND_ASSIGN(OutputSurface); 104 DISALLOW_COPY_AND_ASSIGN(OutputSurface);
102 }; 105 };
103 106
104 } // namespace cc 107 } // namespace cc
105 108
106 #endif // CC_OUTPUT_SURFACE_H_ 109 #endif // CC_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698