| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/pepper/pepper_graphics_2d_host.h" | 5 #include "content/renderer/pepper/pepper_graphics_2d_host.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "content/renderer/pepper/gfx_conversion.h" | 9 #include "content/renderer/pepper/gfx_conversion.h" |
| 10 #include "content/renderer/pepper/mock_renderer_ppapi_host.h" | 10 #include "content/renderer/pepper/mock_renderer_ppapi_host.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace content { | 23 namespace content { |
| 24 | 24 |
| 25 class PepperGraphics2DHostTest : public testing::Test { | 25 class PepperGraphics2DHostTest : public testing::Test { |
| 26 public: | 26 public: |
| 27 static bool ConvertToLogicalPixels(float scale, | 27 static bool ConvertToLogicalPixels(float scale, |
| 28 gfx::Rect* op_rect, | 28 gfx::Rect* op_rect, |
| 29 gfx::Point* delta) { | 29 gfx::Point* delta) { |
| 30 return PepperGraphics2DHost::ConvertToLogicalPixels(scale, op_rect, delta); | 30 return PepperGraphics2DHost::ConvertToLogicalPixels(scale, op_rect, delta); |
| 31 } | 31 } |
| 32 | 32 |
| 33 PepperGraphics2DHostTest() | 33 PepperGraphics2DHostTest() : renderer_ppapi_host_(NULL, 12345) {} |
| 34 : message_loop_(base::MessageLoop::TYPE_DEFAULT), | |
| 35 renderer_ppapi_host_(NULL, 12345) {} | |
| 36 | 34 |
| 37 virtual ~PepperGraphics2DHostTest() { | 35 virtual ~PepperGraphics2DHostTest() { |
| 38 ppapi::ProxyAutoLock proxy_lock; | 36 ppapi::ProxyAutoLock proxy_lock; |
| 39 host_.reset(); | 37 host_.reset(); |
| 40 } | 38 } |
| 41 | 39 |
| 42 void Init(PP_Instance instance, | 40 void Init(PP_Instance instance, |
| 43 const PP_Size& backing_store_size, | 41 const PP_Size& backing_store_size, |
| 44 const PP_Rect& plugin_rect) { | 42 const PP_Rect& plugin_rect) { |
| 45 renderer_view_data_.rect = plugin_rect; | 43 renderer_view_data_.rect = plugin_rect; |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 ResetPageBitmap(&expected_bitmap); | 383 ResetPageBitmap(&expected_bitmap); |
| 386 expected_bitmap.eraseArea( | 384 expected_bitmap.eraseArea( |
| 387 SkIRect::MakeWH(backing_store_size.width, backing_store_size.height), | 385 SkIRect::MakeWH(backing_store_size.width, backing_store_size.height), |
| 388 SkColorSetARGBMacro(255, 255, 0, 0)); | 386 SkColorSetARGBMacro(255, 255, 0, 0)); |
| 389 EXPECT_EQ(memcmp(expected_bitmap.getAddr(0, 0), | 387 EXPECT_EQ(memcmp(expected_bitmap.getAddr(0, 0), |
| 390 actual_bitmap.getAddr(0, 0), | 388 actual_bitmap.getAddr(0, 0), |
| 391 expected_bitmap.getSize()), 0); | 389 expected_bitmap.getSize()), 0); |
| 392 } | 390 } |
| 393 | 391 |
| 394 } // namespace content | 392 } // namespace content |
| OLD | NEW |