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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 { halfPixelX + 1, halfPixelY - 1, 0.5f, 1, 1, 0 }, | 813 { halfPixelX + 1, halfPixelY - 1, 0.5f, 1, 1, 0 }, |
814 { halfPixelX - 1, halfPixelY - 1, 0.5f, 1, 0, 0 } | 814 { halfPixelX - 1, halfPixelY - 1, 0.5f, 1, 0, 0 } |
815 }; | 815 }; |
816 | 816 |
817 if (UsingOcclusionQuery()) { | 817 if (UsingOcclusionQuery()) { |
818 present_thread_->query()->Issue(D3DISSUE_BEGIN); | 818 present_thread_->query()->Issue(D3DISSUE_BEGIN); |
819 } | 819 } |
820 | 820 |
821 present_thread_->device()->BeginScene(); | 821 present_thread_->device()->BeginScene(); |
822 present_thread_->device()->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, | 822 present_thread_->device()->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, |
823 arraysize(vertices), | 823 2, |
824 vertices, | 824 vertices, |
825 sizeof(vertices[0])); | 825 sizeof(vertices[0])); |
826 present_thread_->device()->EndScene(); | 826 present_thread_->device()->EndScene(); |
827 | 827 |
828 present_thread_->device()->SetTexture(0, NULL); | 828 present_thread_->device()->SetTexture(0, NULL); |
829 present_thread_->device()->SetRenderTarget(0, default_render_target); | 829 present_thread_->device()->SetRenderTarget(0, default_render_target); |
830 default_render_target->Release(); | 830 default_render_target->Release(); |
831 } | 831 } |
832 | 832 |
833 hr = present_thread_->query()->Issue(D3DISSUE_END); | 833 hr = present_thread_->query()->Issue(D3DISSUE_END); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 return presenter_->CopyTo(src_subrect, dst_size, buf); | 896 return presenter_->CopyTo(src_subrect, dst_size, buf); |
897 } | 897 } |
898 | 898 |
899 void AcceleratedSurface::Suspend() { | 899 void AcceleratedSurface::Suspend() { |
900 presenter_->Suspend(); | 900 presenter_->Suspend(); |
901 } | 901 } |
902 | 902 |
903 void AcceleratedSurface::WasHidden() { | 903 void AcceleratedSurface::WasHidden() { |
904 presenter_->WasHidden(); | 904 presenter_->WasHidden(); |
905 } | 905 } |
OLD | NEW |