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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 5994002: use accelerated compositing in fullscreen pepper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup resources Created 9 years, 11 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 } 395 }
396 396
397 unsigned PluginInstance::GetBackingTextureId() { 397 unsigned PluginInstance::GetBackingTextureId() {
398 if (!bound_graphics_3d()) 398 if (!bound_graphics_3d())
399 return 0; 399 return 0;
400 400
401 return bound_graphics_3d()->GetBackingTextureId(); 401 return bound_graphics_3d()->GetBackingTextureId();
402 } 402 }
403 403
404 void PluginInstance::CommitBackingTexture() { 404 void PluginInstance::CommitBackingTexture() {
405 container_->commitBackingTexture(); 405 if (fullscreen_container_) {
406 fullscreen_container_->Invalidate();
407 } else {
408 container_->commitBackingTexture();
409 }
406 } 410 }
407 411
408 PP_Var PluginInstance::GetWindowObject() { 412 PP_Var PluginInstance::GetWindowObject() {
409 if (!container_) 413 if (!container_)
410 return PP_MakeUndefined(); 414 return PP_MakeUndefined();
411 415
412 WebFrame* frame = container_->element().document().frame(); 416 WebFrame* frame = container_->element().document().frame();
413 if (!frame) 417 if (!frame)
414 return PP_MakeUndefined(); 418 return PP_MakeUndefined();
415 419
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 WebURLRequest request(complete_url); 933 WebURLRequest request(complete_url);
930 document.frame()->setReferrerForRequest(request, GURL()); 934 document.frame()->setReferrerForRequest(request, GURL());
931 request.setHTTPMethod(WebString::fromUTF8("GET")); 935 request.setHTTPMethod(WebString::fromUTF8("GET"));
932 request.setFirstPartyForCookies(document.firstPartyForCookies()); 936 request.setFirstPartyForCookies(document.firstPartyForCookies());
933 937
934 WebString target_str = WebString::fromUTF8(target); 938 WebString target_str = WebString::fromUTF8(target);
935 container_->loadFrameRequest(request, target_str, false, NULL); 939 container_->loadFrameRequest(request, target_str, false, NULL);
936 return true; 940 return true;
937 } 941 }
938 942
943 PluginDelegate::PlatformContext3D* PluginInstance::CreateContext3D() {
944 if (fullscreen_container_) {
brettw 2011/01/06 17:52:32 To match the surrounding style, don't use {} for s
piman 2011/01/06 20:18:25 It has an else clause - it's required in that case
brettw 2011/01/06 20:22:13 Nope, the only thing different about this is if on
piman 2011/01/06 20:38:58 Aaight, done.
945 return fullscreen_container_->CreateContext3D();
946 } else {
947 return delegate_->CreateContext3D();
948 }
949 }
950
939 bool PluginInstance::PrintPDFOutput(PP_Resource print_output, 951 bool PluginInstance::PrintPDFOutput(PP_Resource print_output,
940 WebKit::WebCanvas* canvas) { 952 WebKit::WebCanvas* canvas) {
941 scoped_refptr<PPB_Buffer_Impl> buffer( 953 scoped_refptr<PPB_Buffer_Impl> buffer(
942 Resource::GetAs<PPB_Buffer_Impl>(print_output)); 954 Resource::GetAs<PPB_Buffer_Impl>(print_output));
943 if (!buffer.get() || !buffer->is_mapped() || !buffer->size()) { 955 if (!buffer.get() || !buffer->is_mapped() || !buffer->size()) {
944 NOTREACHED(); 956 NOTREACHED();
945 return false; 957 return false;
946 } 958 }
947 #if defined(OS_WIN) 959 #if defined(OS_WIN)
948 // For Windows, we need the PDF DLL to render the output PDF to a DC. 960 // For Windows, we need the PDF DLL to render the output PDF to a DC.
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 PPB_Surface3D_Impl* PluginInstance::bound_graphics_3d() const { 1185 PPB_Surface3D_Impl* PluginInstance::bound_graphics_3d() const {
1174 if (bound_graphics_.get() == NULL) 1186 if (bound_graphics_.get() == NULL)
1175 return NULL; 1187 return NULL;
1176 1188
1177 return bound_graphics_->Cast<PPB_Surface3D_Impl>(); 1189 return bound_graphics_->Cast<PPB_Surface3D_Impl>();
1178 } 1190 }
1179 1191
1180 } // namespace ppapi 1192 } // namespace ppapi
1181 } // namespace webkit 1193 } // namespace webkit
1182 1194
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | webkit/plugins/ppapi/ppb_context_3d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698