| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/shell/renderer/test_runner/test_runner.h" | 5 #include "content/shell/renderer/test_runner/test_runner.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/shell/common/test_runner/test_preferences.h" | 10 #include "content/shell/common/test_runner/test_preferences.h" |
| (...skipping 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2924 web_view_->mainFrame()->mainWorldScriptContext(); | 2924 web_view_->mainFrame()->mainWorldScriptContext(); |
| 2925 if (context.IsEmpty()) | 2925 if (context.IsEmpty()) |
| 2926 return; | 2926 return; |
| 2927 | 2927 |
| 2928 v8::Context::Scope context_scope(context); | 2928 v8::Context::Scope context_scope(context); |
| 2929 v8::Local<v8::Value> argv[3]; | 2929 v8::Local<v8::Value> argv[3]; |
| 2930 SkAutoLockPixels snapshot_lock(snapshot); | 2930 SkAutoLockPixels snapshot_lock(snapshot); |
| 2931 | 2931 |
| 2932 // Size can be 0 for cases where copyImageAt was called on position | 2932 // Size can be 0 for cases where copyImageAt was called on position |
| 2933 // that doesn't have an image. | 2933 // that doesn't have an image. |
| 2934 int width = snapshot.info().fWidth; | 2934 int width = snapshot.info().width(); |
| 2935 argv[0] = v8::Number::New(isolate, width); | 2935 argv[0] = v8::Number::New(isolate, width); |
| 2936 | 2936 |
| 2937 int height = snapshot.info().fHeight; | 2937 int height = snapshot.info().height(); |
| 2938 argv[1] = v8::Number::New(isolate, height); | 2938 argv[1] = v8::Number::New(isolate, height); |
| 2939 | 2939 |
| 2940 blink::WebArrayBuffer buffer = | 2940 blink::WebArrayBuffer buffer = |
| 2941 blink::WebArrayBuffer::create(snapshot.getSize(), 1); | 2941 blink::WebArrayBuffer::create(snapshot.getSize(), 1); |
| 2942 memcpy(buffer.data(), snapshot.getPixels(), buffer.byteLength()); | 2942 memcpy(buffer.data(), snapshot.getPixels(), buffer.byteLength()); |
| 2943 #if (SK_R32_SHIFT == 16) && !SK_B32_SHIFT | 2943 #if (SK_R32_SHIFT == 16) && !SK_B32_SHIFT |
| 2944 { | 2944 { |
| 2945 // Skia's internal byte order is BGRA. Must swap the B and R channels in | 2945 // Skia's internal byte order is BGRA. Must swap the B and R channels in |
| 2946 // order to provide a consistent ordering to the layout tests. | 2946 // order to provide a consistent ordering to the layout tests. |
| 2947 unsigned char* pixels = static_cast<unsigned char*>(buffer.data()); | 2947 unsigned char* pixels = static_cast<unsigned char*>(buffer.data()); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3006 } | 3006 } |
| 3007 | 3007 |
| 3008 void TestRunner::DidLosePointerLockInternal() { | 3008 void TestRunner::DidLosePointerLockInternal() { |
| 3009 bool was_locked = pointer_locked_; | 3009 bool was_locked = pointer_locked_; |
| 3010 pointer_locked_ = false; | 3010 pointer_locked_ = false; |
| 3011 if (was_locked) | 3011 if (was_locked) |
| 3012 web_view_->didLosePointerLock(); | 3012 web_view_->didLosePointerLock(); |
| 3013 } | 3013 } |
| 3014 | 3014 |
| 3015 } // namespace content | 3015 } // namespace content |
| OLD | NEW |