Unbreak compilation of ppapi examples.
BUG=none TEST=Examples from ppapi/examples compile. Review URL: http://codereview.chromium.org/6676072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79025 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
ppapi/examples
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||
// 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.
|
||||
|
||||
@ -43,7 +43,7 @@ class MyInstance : public pp::Instance, public pp::PaintManager::Client {
|
||||
paint_manager_.Initialize(this, this, false);
|
||||
}
|
||||
|
||||
virtual bool HandleEvent(const PP_InputEvent& event) {
|
||||
virtual bool HandleInputEvent(const PP_InputEvent& event) {
|
||||
switch (event.type) {
|
||||
case PP_INPUTEVENT_TYPE_MOUSEDOWN: {
|
||||
const PP_InputEvent_Mouse& mouse_event = event.u.mouse;
|
||||
@ -68,19 +68,19 @@ class MyInstance : public pp::Instance, public pp::PaintManager::Client {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void ViewChanged(const pp::Rect& position, const pp::Rect& clip) {
|
||||
virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip) {
|
||||
paint_manager_.SetSize(position.size());
|
||||
}
|
||||
|
||||
// PaintManager::Client implementation.
|
||||
virtual bool OnPaint(pp::Graphics2D& device,
|
||||
virtual bool OnPaint(pp::Graphics2D&,
|
||||
const std::vector<pp::Rect>& paint_rects,
|
||||
const pp::Rect& paint_bounds) {
|
||||
// Make an image just large enough to hold all dirty rects. We won't
|
||||
// actually paint all of these pixels below, but rather just the dirty
|
||||
// ones. Since image allocation can be somewhat heavyweight, we wouldn't
|
||||
// want to allocate separate images in the case of multiple dirty rects.
|
||||
pp::ImageData updated_image(PP_IMAGEDATAFORMAT_BGRA_PREMUL,
|
||||
pp::ImageData updated_image(this, PP_IMAGEDATAFORMAT_BGRA_PREMUL,
|
||||
paint_bounds.size(), false);
|
||||
|
||||
// We could repaint everything inside the image we made above. For this
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||
// 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.
|
||||
|
||||
@ -40,7 +40,7 @@ class MyInstance : public pp::Instance, public pp::PaintManager::Client {
|
||||
paint_manager_.Initialize(this, this, false);
|
||||
}
|
||||
|
||||
virtual void ViewChanged(const pp::Rect& position, const pp::Rect& clip) {
|
||||
virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip) {
|
||||
paint_manager_.SetSize(position.size());
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ class MyInstance : public pp::Instance, public pp::PaintManager::Client {
|
||||
}
|
||||
|
||||
// Paint the background.
|
||||
pp::ImageData updated_image(PP_IMAGEDATAFORMAT_BGRA_PREMUL,
|
||||
pp::ImageData updated_image(this, PP_IMAGEDATAFORMAT_BGRA_PREMUL,
|
||||
paint_bounds.size(), false);
|
||||
FillRect(&updated_image, pp::Rect(updated_image.size()), 0xFF8888FF);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||
// 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.
|
||||
|
||||
@ -20,19 +20,19 @@ class MyInstance : public pp::Instance {
|
||||
: pp::Instance(instance) {
|
||||
}
|
||||
|
||||
virtual void ViewChanged(const pp::Rect& position, const pp::Rect& clip) {
|
||||
virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip) {
|
||||
if (position.size() == last_size_)
|
||||
return;
|
||||
last_size_ = position.size();
|
||||
|
||||
pp::ImageData image(PP_IMAGEDATAFORMAT_BGRA_PREMUL, last_size_, true);
|
||||
pp::Graphics2D device(last_size_, false);
|
||||
pp::ImageData image(this, PP_IMAGEDATAFORMAT_BGRA_PREMUL, last_size_, true);
|
||||
pp::Graphics2D device(this, last_size_, false);
|
||||
BindGraphics(device);
|
||||
|
||||
pp::FontDescription_Dev desc;
|
||||
desc.set_family(PP_FONTFAMILY_SANSSERIF);
|
||||
desc.set_size(30);
|
||||
pp::Font_Dev font(desc);
|
||||
pp::Font_Dev font(this, desc);
|
||||
|
||||
pp::Rect text_clip(position.size()); // Use entire bounds for clip.
|
||||
font.DrawTextAt(&image,
|
||||
|
Reference in New Issue
Block a user