mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
Update skia to latest revision
This commit is contained in:
@@ -21,7 +21,7 @@ vars = {
|
||||
'chromium_git': 'https://chromium.googlesource.com',
|
||||
'mojo_sdk_revision': 'eb7dac2f90187db12c0d29792a0bd999bc96cbe5',
|
||||
'mojo_devtools_revision': '2feda37728d3e551ef543b8f6c4f4b20eaa2d81f',
|
||||
'skia_revision': '29ccdf86ab0a1649fd775c9431891bacb1391e99',
|
||||
'skia_revision': '5015176adf046ef906a2313b6e6b64b72cc84898',
|
||||
'dart_revision': 'cab003366785773ace16b5305ac1f33c228cac54',
|
||||
'dart_observatory_packages_revision': 'cdc4b3d4c15b9c0c8e7702dff127b440afbb7485',
|
||||
|
||||
|
||||
+2
-2
@@ -109,7 +109,7 @@ config("skia_config") {
|
||||
|
||||
defines = gypi_skia_defines.skia_for_chromium_defines
|
||||
|
||||
defines += []
|
||||
defines += [ "SK_SUPPORT_LEGACY_SHADERBITMAPTYPE" ]
|
||||
|
||||
if (component_mode == "shared_library") {
|
||||
defines += [
|
||||
@@ -146,6 +146,7 @@ config("skia_library_config") {
|
||||
# exported to dependents. It's not clear if this is on purpose, but this
|
||||
# matches the GYP build.
|
||||
include_dirs = [
|
||||
"//third_party/skia/include/private",
|
||||
"//third_party/skia/src/core",
|
||||
"//third_party/skia/src/image",
|
||||
"//third_party/skia/src/opts",
|
||||
@@ -357,7 +358,6 @@ component("skia") {
|
||||
"//third_party/skia/src/utils/SkSHA1.cpp",
|
||||
"//third_party/skia/src/utils/SkSHA1.h",
|
||||
"//third_party/skia/src/utils/SkTFitsIn.h",
|
||||
"//third_party/skia/src/utils/SkTLogic.h",
|
||||
|
||||
# We don't currently need to change thread affinity, so leave out this complexity for now.
|
||||
"//third_party/skia/src/utils/SkThreadUtils_pthread_linux.cpp",
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "skia/ext/analysis_canvas.h"
|
||||
#include "third_party/skia/include/core/SkDraw.h"
|
||||
#include "third_party/skia/include/core/SkPath.h"
|
||||
#include "third_party/skia/include/core/SkRRect.h"
|
||||
#include "third_party/skia/include/core/SkShader.h"
|
||||
#include "third_party/skia/src/core/SkRasterClip.h"
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include "skia/ext/benchmarking_canvas.h"
|
||||
#include "third_party/skia/include/core/SkColorFilter.h"
|
||||
#include "third_party/skia/include/core/SkImageFilter.h"
|
||||
#include "third_party/skia/include/core/SkTLazy.h"
|
||||
#include "third_party/skia/include/core/SkPath.h"
|
||||
#include "third_party/skia/include/core/SkPicture.h"
|
||||
#include "third_party/skia/include/core/SkRegion.h"
|
||||
#include "third_party/skia/include/core/SkRRect.h"
|
||||
#include "third_party/skia/include/core/SkString.h"
|
||||
#include "third_party/skia/include/core/SkTextBlob.h"
|
||||
#include "third_party/skia/include/core/SkTLazy.h"
|
||||
#include "third_party/skia/include/core/SkXfermode.h"
|
||||
|
||||
namespace {
|
||||
@@ -360,15 +362,6 @@ scoped_ptr<base::Value> AsValue(const SkPath& path) {
|
||||
{ "move", "line", "quad", "conic", "cubic", "close", "done" };
|
||||
static const int gPtsPerVerb[] = { 1, 1, 2, 2, 3, 0, 0 };
|
||||
static const int gPtOffsetPerVerb[] = { 0, 1, 1, 1, 1, 0, 0 };
|
||||
SK_COMPILE_ASSERT(
|
||||
SK_ARRAY_COUNT(gVerbStrings) == static_cast<size_t>(SkPath::kDone_Verb + 1),
|
||||
gVerbStrings_size_mismatch);
|
||||
SK_COMPILE_ASSERT(
|
||||
SK_ARRAY_COUNT(gVerbStrings) == SK_ARRAY_COUNT(gPtsPerVerb),
|
||||
gPtsPerVerb_size_mismatch);
|
||||
SK_COMPILE_ASSERT(
|
||||
SK_ARRAY_COUNT(gVerbStrings) == SK_ARRAY_COUNT(gPtOffsetPerVerb),
|
||||
gPtOffsetPerVerb_size_mismatch);
|
||||
|
||||
scoped_ptr<base::ListValue> verbs_val(new base::ListValue());
|
||||
SkPath::Iter iter(const_cast<SkPath&>(path), false);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "skia/ext/platform_canvas.h"
|
||||
#include "skia/ext/skia_utils_mac.h"
|
||||
#include "third_party/skia/include/core/SkMatrix.h"
|
||||
#include "third_party/skia/include/core/SkPath.h"
|
||||
#include "third_party/skia/include/core/SkRegion.h"
|
||||
#include "third_party/skia/include/core/SkTypes.h"
|
||||
#include "third_party/skia/include/core/SkUtils.h"
|
||||
|
||||
@@ -10,9 +10,10 @@
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "third_party/skia/include/core/SkData.h"
|
||||
#include "third_party/skia/include/core/SkDraw.h"
|
||||
#include "third_party/skia/include/core/SkPath.h"
|
||||
#include "third_party/skia/include/core/SkPixelRef.h"
|
||||
#include "third_party/skia/include/core/SkRRect.h"
|
||||
#include "third_party/skia/include/core/SkRect.h"
|
||||
#include "third_party/skia/include/core/SkRRect.h"
|
||||
#include "third_party/skia/include/core/SkShader.h"
|
||||
#include "third_party/skia/include/utils/SkNoSaveLayerCanvas.h"
|
||||
#include "third_party/skia/src/core/SkRasterClip.h"
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
# Files are relative to third_party/skia.
|
||||
{
|
||||
'skia_library_sources': [
|
||||
'<(skia_src_path)/core/SkFlate.cpp', # this should likely be moved into src/utils in skia
|
||||
|
||||
'<(skia_src_path)/ports/SkImageGenerator_none.cpp',
|
||||
|
||||
'<(skia_include_path)/images/SkMovie.h',
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
],
|
||||
|
||||
'sources': [
|
||||
# this should likely be moved into src/utils in skia
|
||||
'../third_party/skia/src/core/SkFlate.cpp',
|
||||
|
||||
'../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
|
||||
'../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
|
||||
'../third_party/skia/src/images/SkScaledBitmapSampler.h',
|
||||
|
||||
@@ -213,7 +213,7 @@ void Canvas::drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, const
|
||||
if (!m_canvas)
|
||||
return;
|
||||
ASSERT(image);
|
||||
m_canvas->drawImageRect(image->image(), &src.sk_rect, dst.sk_rect, paint.paint());
|
||||
m_canvas->drawImageRect(image->image(), src.sk_rect, dst.sk_rect, paint.paint());
|
||||
}
|
||||
|
||||
void Canvas::drawPicture(Picture* picture)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "sky/engine/platform/graphics/GraphicsContext.h"
|
||||
|
||||
#include "third_party/skia/include/core/SkPaint.h"
|
||||
#include "third_party/skia/include/core/SkTemplates.h"
|
||||
#include "third_party/skia/include/private/SkTemplates.h"
|
||||
|
||||
#include "sky/engine/wtf/unicode/Unicode.h"
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "sky/engine/platform/fonts/FontPlatformData.h"
|
||||
|
||||
#include "sky/engine/platform/fonts/FontCache.h"
|
||||
#include "third_party/skia/include/core/SkEndian.h"
|
||||
#include "third_party/skia/src/core/SkEndian.h"
|
||||
#include "third_party/skia/include/core/SkTypeface.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -970,7 +970,7 @@ void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
|
||||
SkCanvas::SrcRectConstraint flags =
|
||||
immutableState()->shouldClampToSourceRect() ? SkCanvas::kStrict_SrcRectConstraint : SkCanvas::kFast_SrcRectConstraint;
|
||||
|
||||
m_canvas->drawBitmapRect(bitmap, src, dst, paint, flags);
|
||||
m_canvas->drawBitmapRect(bitmap, *src, dst, paint, flags);
|
||||
|
||||
if (regionTrackingEnabled())
|
||||
m_trackedRegion.didDrawRect(this, dst, *paint, &bitmap);
|
||||
|
||||
@@ -103,7 +103,7 @@ bool ImageFrameGenerator::decodeAndScale(const SkImageInfo& info, size_t index,
|
||||
MutexLocker lock(m_decodeMutex);
|
||||
|
||||
// This implementation does not support scaling so check the requested size.
|
||||
SkISize scaledSize = SkISize::Make(info.fWidth, info.fHeight);
|
||||
SkISize scaledSize = SkISize::Make(info.width(), info.height());
|
||||
ASSERT(m_fullSize == scaledSize);
|
||||
|
||||
if (m_decodeFailedAndEmpty)
|
||||
@@ -128,7 +128,7 @@ bool ImageFrameGenerator::decodeAndScale(const SkImageInfo& info, size_t index,
|
||||
// Check to see if decoder has written directly to the memory provided
|
||||
// by Skia. If not make a copy.
|
||||
if (bitmap.getPixels() != pixels)
|
||||
result = bitmap.copyPixelsTo(pixels, rowBytes * info.fHeight, rowBytes);
|
||||
result = bitmap.copyPixelsTo(pixels, rowBytes * info.height(), rowBytes);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,13 +82,13 @@ SkShader* Pattern::shader()
|
||||
// original, then copy the orignal into it.
|
||||
// FIXME: Is there a better way to pad (not scale) an image in skia?
|
||||
SkImageInfo info = m_tileImage->bitmap().info();
|
||||
info.fWidth += expandW;
|
||||
info.fHeight += expandH;
|
||||
// we explicitly require non-opaquness, since we are going to add a transparent strip.
|
||||
info.fAlphaType = kPremul_SkAlphaType;
|
||||
SkImageInfo newInfo = SkImageInfo::Make(
|
||||
info.width() + expandW, info.height() + expandH, info.colorType(),
|
||||
kPremul_SkAlphaType, info.profileType());
|
||||
|
||||
SkBitmap bm2;
|
||||
bm2.allocPixels(info);
|
||||
bm2.allocPixels(newInfo);
|
||||
bm2.eraseARGB(0x00, 0x00, 0x00, 0x00);
|
||||
SkCanvas canvas(bm2);
|
||||
canvas.drawBitmap(m_tileImage->bitmap(), 0, 0);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "sky/engine/platform/graphics/filters/ParallelJobs.h"
|
||||
#include "sky/engine/platform/graphics/filters/SkiaImageFilterBuilder.h"
|
||||
#include "sky/engine/platform/graphics/skia/NativeImageSkia.h"
|
||||
#include "third_party/skia/include/core/SkPoint3.h"
|
||||
#include "third_party/skia/include/effects/SkLightingImageFilter.h"
|
||||
|
||||
namespace blink {
|
||||
@@ -441,9 +442,9 @@ PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder*
|
||||
DistantLightSource* distantLightSource = static_cast<DistantLightSource*>(m_lightSource.get());
|
||||
float azimuthRad = deg2rad(distantLightSource->azimuth());
|
||||
float elevationRad = deg2rad(distantLightSource->elevation());
|
||||
SkPoint3 direction(cosf(azimuthRad) * cosf(elevationRad),
|
||||
sinf(azimuthRad) * cosf(elevationRad),
|
||||
sinf(elevationRad));
|
||||
SkPoint3 direction = SkPoint3::Make(cosf(azimuthRad) * cosf(elevationRad),
|
||||
sinf(azimuthRad) * cosf(elevationRad),
|
||||
sinf(elevationRad));
|
||||
if (m_specularConstant > 0)
|
||||
return adoptRef(SkLightingImageFilter::CreateDistantLitSpecular(direction, lightColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
|
||||
return adoptRef(SkLightingImageFilter::CreateDistantLitDiffuse(direction, lightColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
|
||||
@@ -451,15 +452,15 @@ PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder*
|
||||
case LS_POINT: {
|
||||
PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_lightSource.get());
|
||||
FloatPoint3D position = pointLightSource->position();
|
||||
SkPoint3 skPosition(position.x(), position.y(), position.z());
|
||||
SkPoint3 skPosition = SkPoint3::Make(position.x(), position.y(), position.z());
|
||||
if (m_specularConstant > 0)
|
||||
return adoptRef(SkLightingImageFilter::CreatePointLitSpecular(skPosition, lightColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
|
||||
return adoptRef(SkLightingImageFilter::CreatePointLitDiffuse(skPosition, lightColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
|
||||
}
|
||||
case LS_SPOT: {
|
||||
SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_lightSource.get());
|
||||
SkPoint3 location(spotLightSource->position().x(), spotLightSource->position().y(), spotLightSource->position().z());
|
||||
SkPoint3 target(spotLightSource->direction().x(), spotLightSource->direction().y(), spotLightSource->direction().z());
|
||||
SkPoint3 location = SkPoint3::Make(spotLightSource->position().x(), spotLightSource->position().y(), spotLightSource->position().z());
|
||||
SkPoint3 target = SkPoint3::Make(spotLightSource->direction().x(), spotLightSource->direction().y(), spotLightSource->direction().z());
|
||||
float specularExponent = spotLightSource->specularExponent();
|
||||
float limitingConeAngle = spotLightSource->limitingConeAngle();
|
||||
if (!limitingConeAngle || limitingConeAngle > 90 || limitingConeAngle < -90)
|
||||
|
||||
@@ -174,12 +174,12 @@ void NativeImageSkia::draw(
|
||||
static SkBitmap createBitmapWithSpace(const SkBitmap& bitmap, int spaceWidth, int spaceHeight)
|
||||
{
|
||||
SkImageInfo info = bitmap.info();
|
||||
info.fWidth += spaceWidth;
|
||||
info.fHeight += spaceHeight;
|
||||
info.fAlphaType = kPremul_SkAlphaType;
|
||||
SkImageInfo newInfo = SkImageInfo::Make(
|
||||
info.width() + spaceWidth, info.height() + spaceHeight,
|
||||
info.colorType(), kPremul_SkAlphaType, info.profileType());
|
||||
|
||||
SkBitmap result;
|
||||
result.allocPixels(info);
|
||||
result.allocPixels(newInfo);
|
||||
result.eraseColor(SK_ColorTRANSPARENT);
|
||||
bitmap.copyPixelsTo(reinterpret_cast<uint8_t*>(result.getPixels()), result.rowBytes() * result.height(), result.rowBytes());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user