| 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/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "base/strings/string_split.h" | 31 #include "base/strings/string_split.h" |
| 32 #include "base/strings/string_util.h" | 32 #include "base/strings/string_util.h" |
| 33 #include "base/strings/sys_string_conversions.h" | 33 #include "base/strings/sys_string_conversions.h" |
| 34 #include "base/strings/utf_string_conversions.h" | 34 #include "base/strings/utf_string_conversions.h" |
| 35 #include "base/sys_info.h" | 35 #include "base/sys_info.h" |
| 36 #include "base/threading/thread_task_runner_handle.h" | 36 #include "base/threading/thread_task_runner_handle.h" |
| 37 #include "base/time/time.h" | 37 #include "base/time/time.h" |
| 38 #include "base/trace_event/trace_event.h" | 38 #include "base/trace_event/trace_event.h" |
| 39 #include "build/build_config.h" | 39 #include "build/build_config.h" |
| 40 #include "cc/base/switches.h" | 40 #include "cc/base/switches.h" |
| 41 #include "cc/paint/skia_paint_canvas.h" |
| 41 #include "content/child/appcache/appcache_dispatcher.h" | 42 #include "content/child/appcache/appcache_dispatcher.h" |
| 42 #include "content/child/appcache/web_application_cache_host_impl.h" | 43 #include "content/child/appcache/web_application_cache_host_impl.h" |
| 43 #include "content/child/child_shared_bitmap_manager.h" | 44 #include "content/child/child_shared_bitmap_manager.h" |
| 44 #include "content/child/request_extra_data.h" | 45 #include "content/child/request_extra_data.h" |
| 45 #include "content/child/v8_value_converter_impl.h" | 46 #include "content/child/v8_value_converter_impl.h" |
| 46 #include "content/child/webmessageportchannel_impl.h" | 47 #include "content/child/webmessageportchannel_impl.h" |
| 47 #include "content/common/content_constants_internal.h" | 48 #include "content/common/content_constants_internal.h" |
| 48 #include "content/common/content_switches_internal.h" | 49 #include "content/common/content_switches_internal.h" |
| 49 #include "content/common/dom_storage/dom_storage_types.h" | 50 #include "content/common/dom_storage/dom_storage_types.h" |
| 50 #include "content/common/drag_messages.h" | 51 #include "content/common/drag_messages.h" |
| (...skipping 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2521 cc::SharedBitmapManager* manager = | 2522 cc::SharedBitmapManager* manager = |
| 2522 RenderThreadImpl::current()->shared_bitmap_manager(); | 2523 RenderThreadImpl::current()->shared_bitmap_manager(); |
| 2523 std::unique_ptr<cc::SharedBitmap> shared_bitmap = | 2524 std::unique_ptr<cc::SharedBitmap> shared_bitmap = |
| 2524 manager->AllocateSharedBitmap(canvas_size); | 2525 manager->AllocateSharedBitmap(canvas_size); |
| 2525 CHECK(!!shared_bitmap); | 2526 CHECK(!!shared_bitmap); |
| 2526 { | 2527 { |
| 2527 SkBitmap bitmap; | 2528 SkBitmap bitmap; |
| 2528 SkImageInfo info = SkImageInfo::MakeN32Premul(canvas_size.width(), | 2529 SkImageInfo info = SkImageInfo::MakeN32Premul(canvas_size.width(), |
| 2529 canvas_size.height()); | 2530 canvas_size.height()); |
| 2530 bitmap.installPixels(info, shared_bitmap->pixels(), info.minRowBytes()); | 2531 bitmap.installPixels(info, shared_bitmap->pixels(), info.minRowBytes()); |
| 2531 cc::PaintCanvas canvas(bitmap); | 2532 cc::SkiaPaintCanvas canvas(bitmap); |
| 2532 | 2533 |
| 2533 // TODO(trchen): Cleanup the device scale factor mess. | 2534 // TODO(trchen): Cleanup the device scale factor mess. |
| 2534 // device scale will be applied in WebKit | 2535 // device scale will be applied in WebKit |
| 2535 // --> zoom_rect doesn't include device scale, | 2536 // --> zoom_rect doesn't include device scale, |
| 2536 // but WebKit will still draw on zoom_rect * device_scale_factor_ | 2537 // but WebKit will still draw on zoom_rect * device_scale_factor_ |
| 2537 canvas.scale(new_total_scale / device_scale_factor_, | 2538 canvas.scale(new_total_scale / device_scale_factor_, |
| 2538 new_total_scale / device_scale_factor_); | 2539 new_total_scale / device_scale_factor_); |
| 2539 canvas.translate(-zoom_rect.x() * device_scale_factor_, | 2540 canvas.translate(-zoom_rect.x() * device_scale_factor_, |
| 2540 -zoom_rect.y() * device_scale_factor_); | 2541 -zoom_rect.y() * device_scale_factor_); |
| 2541 | 2542 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2709 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2710 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 2710 } | 2711 } |
| 2711 | 2712 |
| 2712 std::unique_ptr<InputEventAck> ack( | 2713 std::unique_ptr<InputEventAck> ack( |
| 2713 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), | 2714 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), |
| 2714 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2715 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| 2715 OnInputEventAck(std::move(ack)); | 2716 OnInputEventAck(std::move(ack)); |
| 2716 } | 2717 } |
| 2717 | 2718 |
| 2718 } // namespace content | 2719 } // namespace content |
| OLD | NEW |