| 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 2633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2644 cc::SharedBitmapManager* manager = | 2644 cc::SharedBitmapManager* manager = |
| 2645 RenderThreadImpl::current()->shared_bitmap_manager(); | 2645 RenderThreadImpl::current()->shared_bitmap_manager(); |
| 2646 std::unique_ptr<cc::SharedBitmap> shared_bitmap = | 2646 std::unique_ptr<cc::SharedBitmap> shared_bitmap = |
| 2647 manager->AllocateSharedBitmap(canvas_size); | 2647 manager->AllocateSharedBitmap(canvas_size); |
| 2648 CHECK(!!shared_bitmap); | 2648 CHECK(!!shared_bitmap); |
| 2649 { | 2649 { |
| 2650 SkBitmap bitmap; | 2650 SkBitmap bitmap; |
| 2651 SkImageInfo info = SkImageInfo::MakeN32Premul(canvas_size.width(), | 2651 SkImageInfo info = SkImageInfo::MakeN32Premul(canvas_size.width(), |
| 2652 canvas_size.height()); | 2652 canvas_size.height()); |
| 2653 bitmap.installPixels(info, shared_bitmap->pixels(), info.minRowBytes()); | 2653 bitmap.installPixels(info, shared_bitmap->pixels(), info.minRowBytes()); |
| 2654 SkCanvas canvas(bitmap); | 2654 SkCanvas sk_canvas(bitmap); |
| 2655 CdlPassThroughCanvas canvas(&sk_canvas); |
| 2655 | 2656 |
| 2656 // TODO(trchen): Cleanup the device scale factor mess. | 2657 // TODO(trchen): Cleanup the device scale factor mess. |
| 2657 // device scale will be applied in WebKit | 2658 // device scale will be applied in WebKit |
| 2658 // --> zoom_rect doesn't include device scale, | 2659 // --> zoom_rect doesn't include device scale, |
| 2659 // but WebKit will still draw on zoom_rect * device_scale_factor_ | 2660 // but WebKit will still draw on zoom_rect * device_scale_factor_ |
| 2660 canvas.scale(new_total_scale / device_scale_factor_, | 2661 canvas.scale(new_total_scale / device_scale_factor_, |
| 2661 new_total_scale / device_scale_factor_); | 2662 new_total_scale / device_scale_factor_); |
| 2662 canvas.translate(-zoom_rect.x() * device_scale_factor_, | 2663 canvas.translate(-zoom_rect.x() * device_scale_factor_, |
| 2663 -zoom_rect.y() * device_scale_factor_); | 2664 -zoom_rect.y() * device_scale_factor_); |
| 2664 | 2665 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2812 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2813 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 2813 } | 2814 } |
| 2814 | 2815 |
| 2815 std::unique_ptr<InputEventAck> ack( | 2816 std::unique_ptr<InputEventAck> ack( |
| 2816 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, | 2817 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, |
| 2817 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2818 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| 2818 OnInputEventAck(std::move(ack)); | 2819 OnInputEventAck(std::move(ack)); |
| 2819 } | 2820 } |
| 2820 | 2821 |
| 2821 } // namespace content | 2822 } // namespace content |
| OLD | NEW |