| Index: ppapi/cpp/graphics_2d.cc
|
| diff --git a/ppapi/cpp/graphics_2d.cc b/ppapi/cpp/graphics_2d.cc
|
| index 1ae976bc117d17df45caa0bda7c47a1da5600e94..69bba9c8234028f8549acb8e05f9171f5160c930 100644
|
| --- a/ppapi/cpp/graphics_2d.cc
|
| +++ b/ppapi/cpp/graphics_2d.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 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.
|
|
|
| @@ -18,8 +18,8 @@ namespace pp {
|
|
|
| namespace {
|
|
|
| -template <> const char* interface_name<PPB_Graphics2D>() {
|
| - return PPB_GRAPHICS_2D_INTERFACE;
|
| +template <> const char* interface_name<PPB_Graphics2D_1_0>() {
|
| + return PPB_GRAPHICS_2D_INTERFACE_1_0;
|
| }
|
|
|
| } // namespace
|
| @@ -36,9 +36,9 @@ Graphics2D::Graphics2D(const InstanceHandle& instance,
|
| const Size& size,
|
| bool is_always_opaque)
|
| : Resource() {
|
| - if (!has_interface<PPB_Graphics2D>())
|
| + if (!has_interface<PPB_Graphics2D_1_0>())
|
| return;
|
| - PassRefFromConstructor(get_interface<PPB_Graphics2D>()->Create(
|
| + PassRefFromConstructor(get_interface<PPB_Graphics2D_1_0>()->Create(
|
| instance.pp_instance(),
|
| &size.pp_size(),
|
| PP_FromBool(is_always_opaque)));
|
| @@ -59,9 +59,9 @@ Graphics2D& Graphics2D::operator=(const Graphics2D& other) {
|
|
|
| void Graphics2D::PaintImageData(const ImageData& image,
|
| const Point& top_left) {
|
| - if (!has_interface<PPB_Graphics2D>())
|
| + if (!has_interface<PPB_Graphics2D_1_0>())
|
| return;
|
| - get_interface<PPB_Graphics2D>()->PaintImageData(pp_resource(),
|
| + get_interface<PPB_Graphics2D_1_0>()->PaintImageData(pp_resource(),
|
| image.pp_resource(),
|
| &top_left.pp_point(),
|
| NULL);
|
| @@ -70,26 +70,26 @@ void Graphics2D::PaintImageData(const ImageData& image,
|
| void Graphics2D::PaintImageData(const ImageData& image,
|
| const Point& top_left,
|
| const Rect& src_rect) {
|
| - if (!has_interface<PPB_Graphics2D>())
|
| + if (!has_interface<PPB_Graphics2D_1_0>())
|
| return;
|
| - get_interface<PPB_Graphics2D>()->PaintImageData(pp_resource(),
|
| + get_interface<PPB_Graphics2D_1_0>()->PaintImageData(pp_resource(),
|
| image.pp_resource(),
|
| &top_left.pp_point(),
|
| &src_rect.pp_rect());
|
| }
|
|
|
| void Graphics2D::Scroll(const Rect& clip, const Point& amount) {
|
| - if (!has_interface<PPB_Graphics2D>())
|
| + if (!has_interface<PPB_Graphics2D_1_0>())
|
| return;
|
| - get_interface<PPB_Graphics2D>()->Scroll(pp_resource(),
|
| + get_interface<PPB_Graphics2D_1_0>()->Scroll(pp_resource(),
|
| &clip.pp_rect(),
|
| &amount.pp_point());
|
| }
|
|
|
| void Graphics2D::ReplaceContents(ImageData* image) {
|
| - if (!has_interface<PPB_Graphics2D>())
|
| + if (!has_interface<PPB_Graphics2D_1_0>())
|
| return;
|
| - get_interface<PPB_Graphics2D>()->ReplaceContents(pp_resource(),
|
| + get_interface<PPB_Graphics2D_1_0>()->ReplaceContents(pp_resource(),
|
| image->pp_resource());
|
|
|
| // On success, reset the image data. This is to help prevent people
|
| @@ -98,9 +98,9 @@ void Graphics2D::ReplaceContents(ImageData* image) {
|
| }
|
|
|
| int32_t Graphics2D::Flush(const CompletionCallback& cc) {
|
| - if (!has_interface<PPB_Graphics2D>())
|
| + if (!has_interface<PPB_Graphics2D_1_0>())
|
| return cc.MayForce(PP_ERROR_NOINTERFACE);
|
| - return get_interface<PPB_Graphics2D>()->Flush(pp_resource(),
|
| + return get_interface<PPB_Graphics2D_1_0>()->Flush(pp_resource(),
|
| cc.pp_completion_callback());
|
| }
|
|
|
|
|