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/browser/android/content_readback_handler.h" | 5 #include "content/browser/android/content_readback_handler.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "cc/output/copy_output_request.h" | 9 #include "cc/output/copy_output_request.h" |
10 #include "cc/output/copy_output_result.h" | 10 #include "cc/output/copy_output_result.h" |
11 #include "content/browser/android/content_view_core_impl.h" | 11 #include "content/browser/android/content_view_core_impl.h" |
12 #include "jni/ContentReadbackHandler_jni.h" | 12 #include "jni/ContentReadbackHandler_jni.h" |
13 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
14 #include "ui/base/android/window_android.h" | 14 #include "ui/base/android/window_android.h" |
15 #include "ui/base/android/window_android_compositor.h" | 15 #include "ui/base/android/window_android_compositor.h" |
16 #include "ui/gfx/android/java_bitmap.h" | 16 #include "ui/gfx/android/java_bitmap.h" |
17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 void OnFinishCopyOutputRequest( | 23 void OnFinishCopyOutputRequest( |
24 const ReadbackRequestCallback& result_callback, | 24 const ReadbackRequestCallback& result_callback, |
25 scoped_ptr<cc::CopyOutputResult> copy_output_result) { | 25 scoped_ptr<cc::CopyOutputResult> copy_output_result) { |
26 if (!copy_output_result->HasBitmap()) { | 26 if (!copy_output_result->HasBitmap()) { |
27 result_callback.Run(SkBitmap(), READBACK_FAILED); | 27 result_callback.Run(SkBitmap(), READBACK_FAILED); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 115 } |
116 | 116 |
117 // static | 117 // static |
118 static jlong Init(JNIEnv* env, jobject obj) { | 118 static jlong Init(JNIEnv* env, jobject obj) { |
119 ContentReadbackHandler* content_readback_handler = | 119 ContentReadbackHandler* content_readback_handler = |
120 new ContentReadbackHandler(env, obj); | 120 new ContentReadbackHandler(env, obj); |
121 return reinterpret_cast<intptr_t>(content_readback_handler); | 121 return reinterpret_cast<intptr_t>(content_readback_handler); |
122 } | 122 } |
123 | 123 |
124 } // namespace content | 124 } // namespace content |
OLD | NEW |