OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/glue/webmediaplayer_impl.h" | 5 #include "webkit/glue/webmediaplayer_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 CGContextTranslateCTM(canvas, rect.x, rect.height + rect.y); | 680 CGContextTranslateCTM(canvas, rect.x, rect.height + rect.y); |
681 CGContextScaleCTM(canvas, inverse_scale_x, -inverse_scale_y); | 681 CGContextScaleCTM(canvas, inverse_scale_x, -inverse_scale_y); |
682 | 682 |
683 // We need a local variable CGRect version for DrawToContext. | 683 // We need a local variable CGRect version for DrawToContext. |
684 CGRect normalized_cgrect = | 684 CGRect normalized_cgrect = |
685 CGRectMake(normalized_rect.x(), normalized_rect.y(), | 685 CGRectMake(normalized_rect.x(), normalized_rect.y(), |
686 normalized_rect.width(), normalized_rect.height()); | 686 normalized_rect.width(), normalized_rect.height()); |
687 | 687 |
688 // Copy the frame rendered to our temporary skia canvas onto the passed in | 688 // Copy the frame rendered to our temporary skia canvas onto the passed in |
689 // canvas. | 689 // canvas. |
690 skia_canvas_->getTopPlatformDevice().DrawToContext(canvas, 0, 0, | 690 skia::DrawToNativeContext(skia_canvas_.get(), canvas, 0, 0, |
691 &normalized_cgrect); | 691 &normalized_cgrect); |
692 | 692 |
693 CGContextRestoreGState(canvas); | 693 CGContextRestoreGState(canvas); |
694 #else | 694 #else |
695 NOTIMPLEMENTED() << "We only support rendering to skia or CG"; | 695 NOTIMPLEMENTED() << "We only support rendering to skia or CG"; |
696 #endif | 696 #endif |
697 } | 697 } |
698 | 698 |
699 bool WebMediaPlayerImpl::hasSingleSecurityOrigin() const { | 699 bool WebMediaPlayerImpl::hasSingleSecurityOrigin() const { |
700 if (proxy_) | 700 if (proxy_) |
701 return proxy_->HasSingleOrigin(); | 701 return proxy_->HasSingleOrigin(); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 } | 922 } |
923 } | 923 } |
924 | 924 |
925 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { | 925 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { |
926 DCHECK(MessageLoop::current() == main_loop_); | 926 DCHECK(MessageLoop::current() == main_loop_); |
927 DCHECK(client_); | 927 DCHECK(client_); |
928 return client_; | 928 return client_; |
929 } | 929 } |
930 | 930 |
931 } // namespace webkit_glue | 931 } // namespace webkit_glue |
OLD | NEW |