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 "ui/gfx/canvas.h" | 5 #include "ui/gfx/canvas.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 paint.setShader(shader.get()); | 524 paint.setShader(shader.get()); |
525 paint.setXfermodeMode(SkXfermode::kSrcOver_Mode); | 525 paint.setXfermodeMode(SkXfermode::kSrcOver_Mode); |
526 | 526 |
527 SkRect dest_rect = { SkIntToScalar(dest_x), | 527 SkRect dest_rect = { SkIntToScalar(dest_x), |
528 SkIntToScalar(dest_y), | 528 SkIntToScalar(dest_y), |
529 SkIntToScalar(dest_x + w), | 529 SkIntToScalar(dest_x + w), |
530 SkIntToScalar(dest_y + h) }; | 530 SkIntToScalar(dest_y + h) }; |
531 canvas_->drawRect(dest_rect, paint); | 531 canvas_->drawRect(dest_rect, paint); |
532 } | 532 } |
533 | 533 |
534 NativeDrawingContext Canvas::BeginPlatformPaint() { | |
535 return skia::BeginPlatformPaint(canvas_); | |
536 } | |
537 | |
538 void Canvas::EndPlatformPaint() { | |
539 skia::EndPlatformPaint(canvas_); | |
540 } | |
541 | |
542 void Canvas::Transform(const gfx::Transform& transform) { | 534 void Canvas::Transform(const gfx::Transform& transform) { |
543 canvas_->concat(transform.matrix()); | 535 canvas_->concat(transform.matrix()); |
544 } | 536 } |
545 | 537 |
546 bool Canvas::IntersectsClipRectInt(int x, int y, int w, int h) { | 538 bool Canvas::IntersectsClipRectInt(int x, int y, int w, int h) { |
547 SkRect clip; | 539 SkRect clip; |
548 return canvas_->getClipBounds(&clip) && | 540 return canvas_->getClipBounds(&clip) && |
549 clip.intersect(SkIntToScalar(x), SkIntToScalar(y), SkIntToScalar(x + w), | 541 clip.intersect(SkIntToScalar(x), SkIntToScalar(y), SkIntToScalar(x + w), |
550 SkIntToScalar(y + h)); | 542 SkIntToScalar(y + h)); |
551 } | 543 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 // by the paint). | 613 // by the paint). |
622 SkPaint p(paint); | 614 SkPaint p(paint); |
623 p.setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality); | 615 p.setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality); |
624 p.setShader(shader.get()); | 616 p.setShader(shader.get()); |
625 | 617 |
626 // The rect will be filled by the bitmap. | 618 // The rect will be filled by the bitmap. |
627 canvas_->drawRect(dest_rect, p); | 619 canvas_->drawRect(dest_rect, p); |
628 } | 620 } |
629 | 621 |
630 } // namespace gfx | 622 } // namespace gfx |
OLD | NEW |