Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: ui/gfx/canvas.cc

Issue 1403973002: Remove unused gfx::Canvas API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/canvas.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gfx/canvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698