PPAPI Fullscreen: move out of Dev.
BUG=41780 TEST=in CL Review URL: http://codereview.chromium.org/8291002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105590 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
ppapi
api
c
cpp
native_client
src
shared
tests
ppapi_browser
ppb_fullscreen
ppapi_test_lib
proxy
tests
thunk
webkit/plugins/ppapi
49
ppapi/api/ppb_fullscreen.idl
Normal file
49
ppapi/api/ppb_fullscreen.idl
Normal file
@ -0,0 +1,49 @@
|
||||
/* Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* This file defines the <code>PPB_Fullscreen</code> interface.
|
||||
*/
|
||||
|
||||
label Chrome {
|
||||
M16 = 1.0
|
||||
};
|
||||
|
||||
interface PPB_Fullscreen {
|
||||
/**
|
||||
* Checks whether the plugin instance is currently in fullscreen mode.
|
||||
*/
|
||||
PP_Bool IsFullscreen(
|
||||
[in] PP_Instance instance);
|
||||
|
||||
/**
|
||||
* Switches the plugin instance to/from fullscreen mode. Returns PP_TRUE on
|
||||
* success, PP_FALSE on failure.
|
||||
*
|
||||
* This unbinds the current 2D or 3D devices. Pending flushes and swapbuffers
|
||||
* will execute as if the resource was off-screen. The transition to and from
|
||||
* fullscreen is asynchronous. During the transition, IsFullscreen will
|
||||
* return the original value, and no 2D or 3D device can be bound.
|
||||
* The transition ends at DidChangeView when IsFullscreen returns the new
|
||||
* value. You might receive other DidChangeView calls while in
|
||||
* transition.
|
||||
*
|
||||
* The transition to fullscreen can only occur while the browser is
|
||||
* processing a user gesture, even if PP_TRUE is returned.
|
||||
*/
|
||||
PP_Bool SetFullscreen(
|
||||
[in] PP_Instance instance,
|
||||
[in] PP_Bool fullscreen);
|
||||
|
||||
/**
|
||||
* Gets the size of the screen in pixels. When going fullscreen, the instance
|
||||
* will be resized to that size.
|
||||
*/
|
||||
PP_Bool GetScreenSize(
|
||||
[in] PP_Instance instance,
|
||||
[out] PP_Size size);
|
||||
};
|
||||
|
62
ppapi/c/ppb_fullscreen.h
Normal file
62
ppapi/c/ppb_fullscreen.h
Normal file
@ -0,0 +1,62 @@
|
||||
/* Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
/* From ppb_fullscreen.idl modified Fri Oct 14 02:59:19 2011. */
|
||||
|
||||
#ifndef PPAPI_C_PPB_FULLSCREEN_H_
|
||||
#define PPAPI_C_PPB_FULLSCREEN_H_
|
||||
|
||||
#include "ppapi/c/pp_bool.h"
|
||||
#include "ppapi/c/pp_instance.h"
|
||||
#include "ppapi/c/pp_macros.h"
|
||||
#include "ppapi/c/pp_size.h"
|
||||
#include "ppapi/c/pp_stdint.h"
|
||||
|
||||
#define PPB_FULLSCREEN_INTERFACE_1_0 "PPB_Fullscreen;1.0"
|
||||
#define PPB_FULLSCREEN_INTERFACE PPB_FULLSCREEN_INTERFACE_1_0
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file defines the <code>PPB_Fullscreen</code> interface.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @addtogroup Interfaces
|
||||
* @{
|
||||
*/
|
||||
struct PPB_Fullscreen {
|
||||
/**
|
||||
* Checks whether the plugin instance is currently in fullscreen mode.
|
||||
*/
|
||||
PP_Bool (*IsFullscreen)(PP_Instance instance);
|
||||
/**
|
||||
* Switches the plugin instance to/from fullscreen mode. Returns PP_TRUE on
|
||||
* success, PP_FALSE on failure.
|
||||
*
|
||||
* This unbinds the current 2D or 3D devices. Pending flushes and swapbuffers
|
||||
* will execute as if the resource was off-screen. The transition to and from
|
||||
* fullscreen is asynchronous. During the transition, IsFullscreen will
|
||||
* return the original value, and no 2D or 3D device can be bound.
|
||||
* The transition ends at DidChangeView when IsFullscreen returns the new
|
||||
* value. You might receive other DidChangeView calls while in
|
||||
* transition.
|
||||
*
|
||||
* The transition to fullscreen can only occur while the browser is
|
||||
* processing a user gesture, even if PP_TRUE is returned.
|
||||
*/
|
||||
PP_Bool (*SetFullscreen)(PP_Instance instance, PP_Bool fullscreen);
|
||||
/**
|
||||
* Gets the size of the screen in pixels. When going fullscreen, the instance
|
||||
* will be resized to that size.
|
||||
*/
|
||||
PP_Bool (*GetScreenSize)(PP_Instance instance, struct PP_Size* size);
|
||||
};
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* PPAPI_C_PPB_FULLSCREEN_H_ */
|
||||
|
50
ppapi/cpp/fullscreen.cc
Normal file
50
ppapi/cpp/fullscreen.cc
Normal file
@ -0,0 +1,50 @@
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "ppapi/cpp/fullscreen.h"
|
||||
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "ppapi/cpp/instance.h"
|
||||
#include "ppapi/cpp/module.h"
|
||||
#include "ppapi/cpp/module_impl.h"
|
||||
#include "ppapi/cpp/size.h"
|
||||
|
||||
namespace pp {
|
||||
|
||||
namespace {
|
||||
|
||||
template <> const char* interface_name<PPB_Fullscreen>() {
|
||||
return PPB_FULLSCREEN_INTERFACE;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Fullscreen::Fullscreen(Instance* instance)
|
||||
: instance_(instance) {
|
||||
}
|
||||
|
||||
Fullscreen::~Fullscreen() {
|
||||
}
|
||||
|
||||
bool Fullscreen::IsFullscreen() {
|
||||
return has_interface<PPB_Fullscreen>() &&
|
||||
get_interface<PPB_Fullscreen>()->IsFullscreen(
|
||||
instance_->pp_instance());
|
||||
}
|
||||
|
||||
bool Fullscreen::SetFullscreen(bool fullscreen) {
|
||||
if (!has_interface<PPB_Fullscreen>())
|
||||
return false;
|
||||
return PP_ToBool(get_interface<PPB_Fullscreen>()->SetFullscreen(
|
||||
instance_->pp_instance(), PP_FromBool(fullscreen)));
|
||||
}
|
||||
|
||||
bool Fullscreen::GetScreenSize(Size* size) {
|
||||
if (!has_interface<PPB_Fullscreen>())
|
||||
return false;
|
||||
return PP_ToBool(get_interface<PPB_Fullscreen>()->GetScreenSize(
|
||||
instance_->pp_instance(), &size->pp_size()));
|
||||
}
|
||||
|
||||
} // namespace pp
|
29
ppapi/cpp/fullscreen.h
Normal file
29
ppapi/cpp/fullscreen.h
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef PPAPI_CPP_FULLSCREEN_H_
|
||||
#define PPAPI_CPP_FULLSCREEN_H_
|
||||
|
||||
namespace pp {
|
||||
|
||||
class Instance;
|
||||
class Size;
|
||||
|
||||
class Fullscreen {
|
||||
public:
|
||||
Fullscreen(Instance* instance);
|
||||
virtual ~Fullscreen();
|
||||
|
||||
// PPB_Fullscreen methods.
|
||||
bool IsFullscreen();
|
||||
bool SetFullscreen(bool fullscreen);
|
||||
bool GetScreenSize(Size* size);
|
||||
|
||||
private:
|
||||
Instance* instance_;
|
||||
};
|
||||
|
||||
} // namespace pp
|
||||
|
||||
#endif // PPAPI_CPP_FULLSCREEN_H_
|
@ -387,10 +387,10 @@ const PPB_Font_Dev* PPBFontInterface() {
|
||||
return ppb;
|
||||
}
|
||||
|
||||
const PPB_Fullscreen_Dev* PPBFullscreenInterface() {
|
||||
static const PPB_Fullscreen_Dev* ppb =
|
||||
static_cast<const PPB_Fullscreen_Dev*>(
|
||||
GetBrowserInterfaceSafe(PPB_FULLSCREEN_DEV_INTERFACE));
|
||||
const PPB_Fullscreen* PPBFullscreenInterface() {
|
||||
static const PPB_Fullscreen* ppb =
|
||||
static_cast<const PPB_Fullscreen*>(
|
||||
GetBrowserInterfaceSafe(PPB_FULLSCREEN_INTERFACE));
|
||||
return ppb;
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
|
||||
#include "ppapi/c/dev/ppb_find_dev.h"
|
||||
#include "ppapi/c/dev/ppb_font_dev.h"
|
||||
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
|
||||
#include "ppapi/c/dev/ppb_memory_dev.h"
|
||||
#include "ppapi/c/dev/ppb_mouse_lock_dev.h"
|
||||
#include "ppapi/c/dev/ppb_scrollbar_dev.h"
|
||||
@ -23,6 +22,7 @@
|
||||
#include "ppapi/c/ppb_file_io.h"
|
||||
#include "ppapi/c/ppb_file_ref.h"
|
||||
#include "ppapi/c/ppb_file_system.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "ppapi/c/ppb_graphics_2d.h"
|
||||
#include "ppapi/c/ppb_graphics_3d.h"
|
||||
#include "ppapi/c/ppb_image_data.h"
|
||||
@ -105,7 +105,7 @@ const PPB_FileRef* PPBFileRefInterface();
|
||||
const PPB_FileSystem* PPBFileSystemInterface();
|
||||
const PPB_Find_Dev* PPBFindInterface();
|
||||
const PPB_Font_Dev* PPBFontInterface();
|
||||
const PPB_Fullscreen_Dev* PPBFullscreenInterface();
|
||||
const PPB_Fullscreen* PPBFullscreenInterface();
|
||||
const PPB_Graphics2D* PPBGraphics2DInterface();
|
||||
const PPB_Graphics3D* PPBGraphics3DInterface();
|
||||
const PPB_Graphics3DTrusted* PPBGraphics3DTrustedInterface();
|
||||
|
@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// SRPC-abstraction wrappers around PPB_Fullscreen_Dev functions.
|
||||
// SRPC-abstraction wrappers around PPB_Fullscreen functions.
|
||||
|
||||
#include "native_client/src/shared/ppapi_proxy/browser_globals.h"
|
||||
#include "native_client/src/shared/ppapi_proxy/utility.h"
|
||||
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
|
||||
#include "ppapi/c/pp_size.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "srpcgen/ppb_rpc.h"
|
||||
|
||||
using ppapi_proxy::DebugPrintf;
|
||||
|
@ -60,7 +60,7 @@ InterfaceMapElement interface_map[] = {
|
||||
{ PPB_FILESYSTEM_INTERFACE, PluginFileSystem::GetInterface(), true },
|
||||
{ PPB_FIND_DEV_INTERFACE, PluginFind::GetInterface(), true },
|
||||
{ PPB_FONT_DEV_INTERFACE, PluginFont::GetInterface(), true },
|
||||
{ PPB_FULLSCREEN_DEV_INTERFACE, PluginFullscreen::GetInterface(), true },
|
||||
{ PPB_FULLSCREEN_INTERFACE, PluginFullscreen::GetInterface(), true },
|
||||
{ PPB_GRAPHICS_2D_INTERFACE, PluginGraphics2D::GetInterface(), true },
|
||||
{ PPB_GRAPHICS_3D_INTERFACE, PluginGraphics3D::GetInterface(), true },
|
||||
{ PPB_IMAGEDATA_INTERFACE, PluginImageData::GetInterface(), true },
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h"
|
||||
#include "native_client/src/shared/ppapi_proxy/plugin_globals.h"
|
||||
#include "native_client/src/shared/ppapi_proxy/utility.h"
|
||||
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
|
||||
#include "ppapi/c/pp_size.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "srpcgen/ppb_rpc.h"
|
||||
|
||||
namespace ppapi_proxy {
|
||||
@ -76,8 +76,8 @@ PP_Bool GetScreenSize(PP_Instance instance, struct PP_Size* size) {
|
||||
|
||||
} // namespace
|
||||
|
||||
const PPB_Fullscreen_Dev* PluginFullscreen::GetInterface() {
|
||||
static const PPB_Fullscreen_Dev fullscreen_interface = {
|
||||
const PPB_Fullscreen* PluginFullscreen::GetInterface() {
|
||||
static const PPB_Fullscreen fullscreen_interface = {
|
||||
IsFullscreen,
|
||||
SetFullscreen,
|
||||
GetScreenSize
|
||||
|
@ -6,14 +6,14 @@
|
||||
#define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_PPB_FULLSCREEN_H_
|
||||
|
||||
#include "native_client/src/include/nacl_macros.h"
|
||||
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
|
||||
namespace ppapi_proxy {
|
||||
|
||||
// Implements the untrusted side of the PPB_Fullscreen_Dev interface.
|
||||
// Implements the untrusted side of the PPB_Fullscreen interface.
|
||||
class PluginFullscreen {
|
||||
public:
|
||||
static const PPB_Fullscreen_Dev* GetInterface();
|
||||
static const PPB_Fullscreen* GetInterface();
|
||||
|
||||
private:
|
||||
NACL_DISALLOW_COPY_AND_ASSIGN(PluginFullscreen);
|
||||
|
@ -2,8 +2,8 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# RPC methods used to implement PPB_Fullscreen_Dev interface.
|
||||
# See ppapi/c/dev/ppb_fullscreen_dev.h for interface details.
|
||||
# RPC methods used to implement PPB_Fullscreen interface.
|
||||
# See ppapi/c/dev/ppb_fullscreen.h for interface details.
|
||||
{
|
||||
'name': 'PpbFullscreenRpc',
|
||||
'rpcs': [
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Tests PPB_Fullscreen_Dev.
|
||||
// Tests PPB_Fullscreen.
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
#include "native_client/tests/ppapi_test_lib/test_interface.h"
|
||||
#include "native_client/tests/ppapi_test_lib/testable_callback.h"
|
||||
|
||||
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
|
||||
#include "ppapi/c/ppb_core.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "ppapi/c/ppb_graphics_2d.h"
|
||||
#include "ppapi/c/ppb_input_event.h"
|
||||
#include "ppapi/c/ppb_instance.h"
|
||||
@ -66,24 +66,17 @@ bool CreateGraphics2D(PP_Resource* graphics2d) {
|
||||
// Test cases
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Test for the availability of PPB_FULLSCREEN_DEV_INTERFACE.
|
||||
void TestGetInterface() {
|
||||
printf("--- TestGetInterface\n");
|
||||
EXPECT(PPBFullscreenDev() != NULL);
|
||||
TEST_PASSED;
|
||||
}
|
||||
|
||||
// Test
|
||||
// PP_Bool (*IsFullscreen)(PP_Instance instance);
|
||||
void TestIsFullscreenTrue() {
|
||||
printf("--- TestIsFullscreenTrue\n");
|
||||
EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_TRUE);
|
||||
EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_TRUE);
|
||||
TEST_PASSED;
|
||||
}
|
||||
|
||||
void TestIsFullscreenFalse() {
|
||||
printf("--- TestIsFullscreenFalse\n");
|
||||
EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE);
|
||||
EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_FALSE);
|
||||
TEST_PASSED;
|
||||
}
|
||||
|
||||
@ -94,7 +87,7 @@ bool g_normal_pending = false;
|
||||
|
||||
void TestSetFullscreenTrue() {
|
||||
printf("--- TestSetFullscreenTrue\n");
|
||||
const PPB_Fullscreen_Dev* ppb = PPBFullscreenDev();
|
||||
const PPB_Fullscreen* ppb = PPBFullscreen();
|
||||
if (ppb->IsFullscreen(pp_instance()) == PP_FALSE) {
|
||||
// Transition to fullscreen.
|
||||
// This can only be done when processing a user gesture -
|
||||
@ -113,7 +106,7 @@ void TestSetFullscreenTrue() {
|
||||
|
||||
void TestSetFullscreenFalse() {
|
||||
printf("--- TestSetFullscreenFalse\n");
|
||||
const PPB_Fullscreen_Dev* ppb = PPBFullscreenDev();
|
||||
const PPB_Fullscreen* ppb = PPBFullscreen();
|
||||
if (ppb->IsFullscreen(pp_instance()) == PP_TRUE) {
|
||||
// Transition out of fullscreen.
|
||||
EXPECT(CreateGraphics2D(&g_graphics2d));
|
||||
@ -142,7 +135,7 @@ void TestSetFullscreenFalse() {
|
||||
|
||||
void TestGetScreenSizeHelper(PP_Size min_size, PP_Size max_size) {
|
||||
PP_Size size = PP_MakeSize(0, 0);
|
||||
EXPECT(PPBFullscreenDev()->GetScreenSize(pp_instance(), &size) == PP_TRUE);
|
||||
EXPECT(PPBFullscreen()->GetScreenSize(pp_instance(), &size) == PP_TRUE);
|
||||
EXPECT(IsSizeInRange(size, min_size, max_size));
|
||||
}
|
||||
|
||||
@ -179,15 +172,15 @@ PP_Bool HandleInputEvent(PP_Instance instance, PP_Resource event) {
|
||||
// We got the user gesture we needed, no need to handle events anymore.
|
||||
PPBInputEvent()->ClearInputEventRequest(pp_instance(),
|
||||
PP_INPUTEVENT_CLASS_MOUSE);
|
||||
EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE);
|
||||
EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_FALSE);
|
||||
EXPECT(CreateGraphics2D(&g_graphics2d));
|
||||
EXPECT(PPBFullscreenDev()->SetFullscreen(pp_instance(), PP_TRUE) == PP_TRUE);
|
||||
EXPECT(PPBFullscreen()->SetFullscreen(pp_instance(), PP_TRUE) == PP_TRUE);
|
||||
g_fullscreen_pending = true;
|
||||
// Transition is pending, so additional requests fail.
|
||||
EXPECT(PPBFullscreenDev()->SetFullscreen(pp_instance(), PP_TRUE) == PP_FALSE);
|
||||
EXPECT(PPBFullscreenDev()->SetFullscreen(pp_instance(), PP_FALSE) ==
|
||||
EXPECT(PPBFullscreen()->SetFullscreen(pp_instance(), PP_TRUE) == PP_FALSE);
|
||||
EXPECT(PPBFullscreen()->SetFullscreen(pp_instance(), PP_FALSE) ==
|
||||
PP_FALSE);
|
||||
EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE);
|
||||
EXPECT(PPBFullscreen()->IsFullscreen(pp_instance()) == PP_FALSE);
|
||||
// No 2D or 3D device can be bound during transition.
|
||||
EXPECT(PPBGraphics2D()->IsGraphics2D(g_graphics2d) == PP_TRUE);
|
||||
EXPECT(PPBInstance()->BindGraphics(pp_instance(), g_graphics2d) ==
|
||||
@ -206,7 +199,7 @@ const PPP_InputEvent ppp_input_event_interface = {
|
||||
|
||||
PP_Size GetScreenSize() {
|
||||
PP_Size screen_size = PP_MakeSize(0, 0);
|
||||
CHECK(PPBFullscreenDev()->GetScreenSize(pp_instance(), &screen_size));
|
||||
CHECK(PPBFullscreen()->GetScreenSize(pp_instance(), &screen_size));
|
||||
return screen_size;
|
||||
}
|
||||
|
||||
@ -245,14 +238,14 @@ void DidChangeView(PP_Instance instance,
|
||||
|
||||
const char* test = NULL;
|
||||
PP_Size screen_size = GetScreenSize();
|
||||
if (g_fullscreen_pending && PPBFullscreenDev()->IsFullscreen(pp_instance())) {
|
||||
if (g_fullscreen_pending && PPBFullscreen()->IsFullscreen(pp_instance())) {
|
||||
test = "TestSetFullscreenTrue";
|
||||
g_fullscreen_pending = false;
|
||||
EXPECT(IsSizeEqual(position->size, screen_size));
|
||||
// NOTE: we cannot reliably test for clip size being equal to the screen
|
||||
// because it might be affected by JS console, info bars, etc.
|
||||
} else if (g_normal_pending &&
|
||||
!PPBFullscreenDev()->IsFullscreen(pp_instance())) {
|
||||
!PPBFullscreen()->IsFullscreen(pp_instance())) {
|
||||
test = "TestSetFullscreenFalse";
|
||||
g_normal_pending = false;
|
||||
EXPECT(IsRectEqual(*position, g_normal_position));
|
||||
@ -277,7 +270,6 @@ const PPP_Instance ppp_instance_interface = {
|
||||
} // namespace
|
||||
|
||||
void SetupTests() {
|
||||
RegisterTest("TestGetInterface", TestGetInterface);
|
||||
RegisterTest("TestIsFullscreenTrue", TestIsFullscreenTrue);
|
||||
RegisterTest("TestIsFullscreenFalse", TestIsFullscreenFalse);
|
||||
RegisterTest("TestSetFullscreenTrue", TestSetFullscreenTrue);
|
||||
|
@ -35,7 +35,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
addTest("TestGetInterface");
|
||||
if (screen.width == 2560 && screen.height == 1600) // 30-inch.
|
||||
addTest("TestGetScreenSize2560x1600");
|
||||
else if (screen.width == 1920 && screen.height == 1200) // 24-inch.
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "ppapi/c/dev/ppb_context_3d_dev.h"
|
||||
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
|
||||
#include "ppapi/c/dev/ppb_font_dev.h"
|
||||
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
|
||||
#include "ppapi/c/dev/ppb_memory_dev.h"
|
||||
#include "ppapi/c/dev/ppb_scrollbar_dev.h"
|
||||
#include "ppapi/c/dev/ppb_surface_3d_dev.h"
|
||||
@ -18,6 +17,7 @@
|
||||
#include "ppapi/c/ppb_file_io.h"
|
||||
#include "ppapi/c/ppb_file_ref.h"
|
||||
#include "ppapi/c/ppb_file_system.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "ppapi/c/ppb_graphics_2d.h"
|
||||
#include "ppapi/c/ppb_graphics_3d.h"
|
||||
#include "ppapi/c/ppb_image_data.h"
|
||||
@ -65,6 +65,11 @@ const PPB_FileSystem* PPBFileSystem() {
|
||||
GetBrowserInterface(PPB_FILESYSTEM_INTERFACE));
|
||||
}
|
||||
|
||||
const PPB_Fullscreen* PPBFullscreen() {
|
||||
return reinterpret_cast<const PPB_Fullscreen*>(
|
||||
GetBrowserInterfaceSafe(PPB_FULLSCREEN_INTERFACE));
|
||||
}
|
||||
|
||||
const PPB_Graphics2D* PPBGraphics2D() {
|
||||
return reinterpret_cast<const PPB_Graphics2D*>(
|
||||
GetBrowserInterfaceSafe(PPB_GRAPHICS_2D_INTERFACE));
|
||||
@ -153,11 +158,6 @@ const PPB_Font_Dev* PPBFontDev() {
|
||||
GetBrowserInterface(PPB_FONT_DEV_INTERFACE));
|
||||
}
|
||||
|
||||
const PPB_Fullscreen_Dev* PPBFullscreenDev() {
|
||||
return reinterpret_cast<const PPB_Fullscreen_Dev*>(
|
||||
GetBrowserInterface(PPB_FULLSCREEN_DEV_INTERFACE));
|
||||
}
|
||||
|
||||
const PPB_Memory_Dev* PPBMemoryDev() {
|
||||
return reinterpret_cast<const PPB_Memory_Dev*>(
|
||||
GetBrowserInterface(PPB_MEMORY_DEV_INTERFACE));
|
||||
|
@ -20,7 +20,7 @@ struct PPB_FileIO;
|
||||
struct PPB_FileRef;
|
||||
struct PPB_FileSystem;
|
||||
struct PPB_Font_Dev;
|
||||
struct PPB_Fullscreen_Dev;
|
||||
struct PPB_Fullscreen;
|
||||
struct PPB_Graphics2D;
|
||||
struct PPB_Graphics3D;
|
||||
struct PPB_ImageData;
|
||||
@ -54,6 +54,7 @@ const PPB_Core* PPBCore();
|
||||
const PPB_FileIO* PPBFileIO();
|
||||
const PPB_FileRef* PPBFileRef();
|
||||
const PPB_FileSystem* PPBFileSystem();
|
||||
const PPB_Fullscreen* PPBFullscreen();
|
||||
const PPB_Graphics2D* PPBGraphics2D();
|
||||
const PPB_Graphics3D* PPBGraphics3D();
|
||||
const PPB_ImageData* PPBImageData();
|
||||
@ -77,7 +78,6 @@ const PPB_WheelInputEvent* PPBWheelInputEvent();
|
||||
const PPB_Context3D_Dev* PPBContext3DDev();
|
||||
const PPB_CursorControl_Dev* PPBCursorControlDev();
|
||||
const PPB_Font_Dev* PPBFontDev();
|
||||
const PPB_Fullscreen_Dev* PPBFullscreenDev();
|
||||
const PPB_Memory_Dev* PPBMemoryDev();
|
||||
const PPB_Scrollbar_Dev* PPBScrollbarDev();
|
||||
const PPB_Surface3D_Dev* PPBSurface3DDev();
|
||||
|
@ -36,6 +36,7 @@
|
||||
'c/ppb_file_io.h',
|
||||
'c/ppb_file_ref.h',
|
||||
'c/ppb_file_system.h',
|
||||
'c/ppb_fullscreen.h',
|
||||
'c/ppb_graphics_2d.h',
|
||||
'c/ppb_graphics_3d.h',
|
||||
'c/ppb_image_data.h',
|
||||
@ -155,6 +156,8 @@
|
||||
'cpp/file_ref.h',
|
||||
'cpp/file_system.cc',
|
||||
'cpp/file_system.h',
|
||||
'cpp/fullscreen.cc',
|
||||
'cpp/fullscreen.h',
|
||||
'cpp/graphics_2d.cc',
|
||||
'cpp/graphics_2d.h',
|
||||
'cpp/graphics_3d.cc',
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "ppapi/c/ppb_core.h"
|
||||
#include "ppapi/c/ppb_file_ref.h"
|
||||
#include "ppapi/c/ppb_file_system.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "ppapi/c/ppb_graphics_2d.h"
|
||||
#include "ppapi/c/ppb_image_data.h"
|
||||
#include "ppapi/c/ppb_input_event.h"
|
||||
|
@ -35,7 +35,7 @@ namespace proxy {
|
||||
struct InstanceData {
|
||||
InstanceData();
|
||||
PP_Rect position;
|
||||
PP_Bool fullscreen; // Used for PPB_Fullscreen_Dev.
|
||||
PP_Bool fullscreen; // Used for PPB_Fullscreen.
|
||||
PP_Bool flash_fullscreen; // Used for PPB_FlashFullscreen.
|
||||
};
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "ipc/ipc_message_utils.h"
|
||||
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
|
||||
#include "ppapi/c/pp_var.h"
|
||||
#include "ppapi/c/ppb_core.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "ppapi/c/ppb_url_loader.h"
|
||||
#include "ppapi/c/ppp_instance.h"
|
||||
#include "ppapi/c/private/ppb_flash_fullscreen.h"
|
||||
@ -95,7 +95,7 @@ PPP_Instance_1_0 ppp_instance_1_0 = {
|
||||
PP_Bool IsFullscreen(PP_Instance instance) {
|
||||
return PP_FALSE;
|
||||
}
|
||||
PPB_Fullscreen_Dev ppb_fullscreen = { &IsFullscreen };
|
||||
PPB_Fullscreen ppb_fullscreen = { &IsFullscreen };
|
||||
PPB_FlashFullscreen ppb_flash_fullscreen = { &IsFullscreen };
|
||||
|
||||
} // namespace
|
||||
@ -111,7 +111,7 @@ TEST_F(PPP_Instance_ProxyTest, PPPInstance1_0) {
|
||||
plugin().RegisterTestInterface(PPP_INSTANCE_INTERFACE_1_0, &ppp_instance_1_0);
|
||||
host().RegisterTestInterface(PPB_FLASHFULLSCREEN_INTERFACE,
|
||||
&ppb_flash_fullscreen);
|
||||
host().RegisterTestInterface(PPB_FULLSCREEN_DEV_INTERFACE,
|
||||
host().RegisterTestInterface(PPB_FULLSCREEN_INTERFACE,
|
||||
&ppb_fullscreen);
|
||||
|
||||
// Grab the host-side proxy for the 1.0 interface.
|
||||
|
@ -74,6 +74,7 @@
|
||||
#include "ppapi/c/ppb_file_io.h"
|
||||
#include "ppapi/c/ppb_file_ref.h"
|
||||
#include "ppapi/c/ppb_file_system.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "ppapi/c/ppb_graphics_2d.h"
|
||||
#include "ppapi/c/ppb_graphics_3d.h"
|
||||
#include "ppapi/c/ppb_image_data.h"
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "ppapi/cpp/file_io.h"
|
||||
#include "ppapi/cpp/file_ref.h"
|
||||
#include "ppapi/cpp/file_system.h"
|
||||
#include "ppapi/cpp/fullscreen.h"
|
||||
#include "ppapi/cpp/graphics_2d.h"
|
||||
#include "ppapi/cpp/graphics_3d.h"
|
||||
#include "ppapi/cpp/graphics_3d_client.h"
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "ppapi/c/dev/ppb_testing_dev.h"
|
||||
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "ppapi/cpp/input_event.h"
|
||||
#include "ppapi/cpp/instance.h"
|
||||
#include "ppapi/cpp/module.h"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ppapi/cpp/dev/fullscreen_dev.h"
|
||||
#include "ppapi/cpp/fullscreen.h"
|
||||
#include "ppapi/cpp/graphics_2d.h"
|
||||
#include "ppapi/cpp/rect.h"
|
||||
#include "ppapi/cpp/size.h"
|
||||
@ -39,7 +39,7 @@ class TestFullscreen : public TestCase {
|
||||
|
||||
std::string error_;
|
||||
|
||||
pp::Fullscreen_Dev screen_mode_;
|
||||
pp::Fullscreen screen_mode_;
|
||||
pp::Size screen_size_;
|
||||
pp::Rect normal_position_;
|
||||
|
||||
|
@ -41,7 +41,6 @@ PROXIED_IFACE(PPB_FileChooser, PPB_FILECHOOSER_DEV_INTERFACE_0_5,
|
||||
PROXIED_IFACE(PPB_Font, PPB_FONT_DEV_INTERFACE_0_6, PPB_Font_Dev)
|
||||
PROXIED_IFACE(PPB_Instance, PPB_CHAR_SET_DEV_INTERFACE_0_4, PPB_CharSet_Dev)
|
||||
PROXIED_IFACE(PPB_Instance, PPB_CONSOLE_DEV_INTERFACE, PPB_Console_Dev)
|
||||
PROXIED_IFACE(PPB_Instance, PPB_FULLSCREEN_DEV_INTERFACE, PPB_Fullscreen_Dev)
|
||||
PROXIED_IFACE(PPB_Instance, PPB_MOUSELOCK_DEV_INTERFACE_0_1,
|
||||
PPB_MouseLock_Dev)
|
||||
UNPROXIED_IFACE(PPB_Instance, PPB_QUERYPOLICY_DEV_INTERFACE_0_1,
|
||||
|
@ -68,6 +68,7 @@ PROXIED_IFACE(NoAPIName, PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1,
|
||||
PPB_MouseInputEvent)
|
||||
PROXIED_IFACE(NoAPIName, PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0,
|
||||
PPB_WheelInputEvent)
|
||||
PROXIED_IFACE(PPB_Instance, PPB_FULLSCREEN_INTERFACE_1_0, PPB_Fullscreen)
|
||||
PROXIED_IFACE(PPB_Instance, PPB_MESSAGING_INTERFACE_1_0, PPB_Messaging)
|
||||
PROXIED_IFACE(PPB_URLLoader, PPB_URLLOADER_INTERFACE_1_0, PPB_URLLoader)
|
||||
PROXIED_IFACE(NoAPIName, PPB_URLREQUESTINFO_INTERFACE_1_0, PPB_URLRequestInfo)
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "ppapi/thunk/thunk.h"
|
||||
#include "ppapi/thunk/enter.h"
|
||||
#include "ppapi/thunk/ppb_instance_api.h"
|
||||
@ -34,7 +34,7 @@ PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) {
|
||||
return enter.functions()->GetScreenSize(instance, size);
|
||||
}
|
||||
|
||||
const PPB_Fullscreen_Dev g_ppb_fullscreen_thunk = {
|
||||
const PPB_Fullscreen g_ppb_fullscreen_thunk = {
|
||||
&IsFullscreen,
|
||||
&SetFullscreen,
|
||||
&GetScreenSize
|
||||
@ -42,7 +42,7 @@ const PPB_Fullscreen_Dev g_ppb_fullscreen_thunk = {
|
||||
|
||||
} // namespace
|
||||
|
||||
const PPB_Fullscreen_Dev* GetPPB_Fullscreen_Dev_Thunk() {
|
||||
const PPB_Fullscreen* GetPPB_Fullscreen_Thunk() {
|
||||
return &g_ppb_fullscreen_thunk;
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "ppapi/c/ppb_file_io.h"
|
||||
#include "ppapi/c/ppb_file_ref.h"
|
||||
#include "ppapi/c/ppb_file_system.h"
|
||||
#include "ppapi/c/ppb_fullscreen.h"
|
||||
#include "ppapi/c/ppb_graphics_2d.h"
|
||||
#include "ppapi/c/ppb_graphics_3d.h"
|
||||
#include "ppapi/c/ppb_image_data.h"
|
||||
@ -275,6 +276,8 @@ const void* GetInterface(const char* name) {
|
||||
return ::ppapi::thunk::GetPPB_Flash_UDPSocket_Thunk();
|
||||
if (strcmp(name, PPB_FULLSCREEN_DEV_INTERFACE_0_4) == 0)
|
||||
return ::ppapi::thunk::GetPPB_FlashFullscreen_Thunk();
|
||||
if (strcmp(name, PPB_FULLSCREEN_DEV_INTERFACE) == 0)
|
||||
return ::ppapi::thunk::GetPPB_Fullscreen_Thunk();
|
||||
if (strcmp(name, PPB_GPU_BLACKLIST_INTERFACE) == 0)
|
||||
return PPB_GpuBlacklist_Private_Impl::GetInterface();
|
||||
if (strcmp(name, PPB_GRAPHICS_3D_TRUSTED_INTERFACE) == 0)
|
||||
|
@ -1576,7 +1576,7 @@ PPB_Surface3D_Impl* PluginInstance::GetBoundSurface3D() const {
|
||||
|
||||
void PluginInstance::setBackingTextureId(unsigned int id) {
|
||||
// If we have a fullscreen_container_ (under PPB_FlashFullscreen)
|
||||
// or desired_fullscreen_state is true (under PPB_Fullscreen_Dev),
|
||||
// or desired_fullscreen_state is true (under PPB_Fullscreen),
|
||||
// then the plugin is fullscreen or transitioning to fullscreen
|
||||
// and the parent context is not the one for the browser page,
|
||||
// but for the fullscreen window, and so the parent texture ID
|
||||
@ -1647,7 +1647,7 @@ PP_Bool PluginInstance::BindGraphics(PP_Instance instance,
|
||||
}
|
||||
|
||||
// Refuse to bind if in transition to fullscreen with PPB_FlashFullscreen or
|
||||
// to/from fullscreen with PPB_Fullscreen_Dev.
|
||||
// to/from fullscreen with PPB_Fullscreen.
|
||||
if ((fullscreen_container_ && !flash_fullscreen_) ||
|
||||
desired_fullscreen_state_ != fullscreen_)
|
||||
return PP_FALSE;
|
||||
|
@ -229,8 +229,8 @@ class PluginInstance : public base::RefCounted<PluginInstance>,
|
||||
void Graphics3DContextLost();
|
||||
|
||||
// There are 2 implementations of the fullscreen interface
|
||||
// PPB_FlashFullscreen_Dev is used by Pepper Flash.
|
||||
// PPB_Fullscreen_Dev is intended for other applications including NaCl.
|
||||
// PPB_FlashFullscreen is used by Pepper Flash.
|
||||
// PPB_Fullscreen is intended for other applications including NaCl.
|
||||
// The two interface are mutually exclusive.
|
||||
|
||||
// Implementation of PPB_FlashFullscreen.
|
||||
@ -261,7 +261,7 @@ class PluginInstance : public base::RefCounted<PluginInstance>,
|
||||
return fullscreen_container_;
|
||||
}
|
||||
|
||||
// Implementation of PPB_Fullscreen_Dev.
|
||||
// Implementation of PPB_Fullscreen.
|
||||
|
||||
// Because going to/from fullscreen is asynchronous, there are 4 states:
|
||||
// - normal : desired_fullscreen_state_ == false
|
||||
@ -569,7 +569,7 @@ class PluginInstance : public base::RefCounted<PluginInstance>,
|
||||
// in transition to fullscreen.
|
||||
bool flash_fullscreen_;
|
||||
|
||||
// Implementation of PPB_Fullscreen_Dev.
|
||||
// Implementation of PPB_Fullscreen.
|
||||
|
||||
// Since entering fullscreen mode is an asynchronous operation, we set this
|
||||
// variable to the desired state at the time we issue the fullscreen change
|
||||
|
Reference in New Issue
Block a user