OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "ui/surface/accelerated_surface_win.h" | 5 #include "ui/surface/accelerated_surface_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 size.height(), | 151 size.height(), |
152 D3DFMT_A8R8G8B8, | 152 D3DFMT_A8R8G8B8, |
153 D3DMULTISAMPLE_NONE, | 153 D3DMULTISAMPLE_NONE, |
154 0, | 154 0, |
155 TRUE, | 155 TRUE, |
156 surface, | 156 surface, |
157 NULL); | 157 NULL); |
158 return SUCCEEDED(hr); | 158 return SUCCEEDED(hr); |
159 } | 159 } |
160 | 160 |
161 } // namespace anonymous | 161 } // namespace |
162 | 162 |
163 // A PresentThread is a thread that is dedicated to presenting surfaces to a | 163 // A PresentThread is a thread that is dedicated to presenting surfaces to a |
164 // window. It owns a Direct3D device and a Direct3D query for this purpose. | 164 // window. It owns a Direct3D device and a Direct3D query for this purpose. |
165 class PresentThread : public base::Thread, | 165 class PresentThread : public base::Thread, |
166 public base::RefCountedThreadSafe<PresentThread> { | 166 public base::RefCountedThreadSafe<PresentThread> { |
167 public: | 167 public: |
168 explicit PresentThread(const char* name); | 168 explicit PresentThread(const char* name); |
169 | 169 |
170 IDirect3DDevice9Ex* device() { return device_.get(); } | 170 IDirect3DDevice9Ex* device() { return device_.get(); } |
171 IDirect3DQuery9* query() { return query_.get(); } | 171 IDirect3DQuery9* query() { return query_.get(); } |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 return presenter_->CopyTo(size, buf); | 851 return presenter_->CopyTo(size, buf); |
852 } | 852 } |
853 | 853 |
854 void AcceleratedSurface::Suspend() { | 854 void AcceleratedSurface::Suspend() { |
855 presenter_->Suspend(); | 855 presenter_->Suspend(); |
856 } | 856 } |
857 | 857 |
858 void AcceleratedSurface::WasHidden() { | 858 void AcceleratedSurface::WasHidden() { |
859 presenter_->WasHidden(); | 859 presenter_->WasHidden(); |
860 } | 860 } |
OLD | NEW |