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

Unified Diff: third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp

Issue 2849303002: Use PaintRecorder instead of PaintRecordBuilder in PlaceholderImage. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp b/third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp
index ab886c0f4d0c6c794b1b6adb73898be645f15969..7568274466f04774c3ba474a888d4ec629d280ea 100644
--- a/third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp
@@ -6,10 +6,9 @@
#include "platform/geometry/FloatRect.h"
#include "platform/graphics/Color.h"
-#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/ImageObserver.h"
#include "platform/graphics/paint/PaintRecord.h"
-#include "platform/graphics/paint/PaintRecordBuilder.h"
+#include "platform/graphics/paint/PaintRecorder.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkSize.h"
@@ -31,15 +30,12 @@ sk_sp<SkImage> PlaceholderImage::ImageForCurrentFrame() {
const FloatRect dest_rect(0.0f, 0.0f, static_cast<float>(size_.Width()),
static_cast<float>(size_.Height()));
- PaintRecordBuilder builder(dest_rect);
- GraphicsContext& context = builder.Context();
- context.BeginRecording(dest_rect);
-
- context.SetFillColor(kFillColor);
- context.FillRect(dest_rect);
+ PaintRecorder paint_recorder;
+ Draw(paint_recorder.beginRecording(dest_rect), PaintFlags(), dest_rect,
+ dest_rect, kDoNotRespectImageOrientation, kClampImageToSourceRect);
image_for_current_frame_ = SkImage::MakeFromPicture(
- ToSkPicture(builder.EndRecording()),
+ ToSkPicture(paint_recorder.finishRecordingAsPicture()),
SkISize::Make(size_.Width(), size_.Height()), nullptr, nullptr,
SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698